mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 09:43:13 +02:00
Code cleanup: renamed some constants and variables (prefix added)
This commit is contained in:
@@ -269,7 +269,7 @@ plugin_config_read ()
|
||||
pos = strchr (line, '=');
|
||||
if (pos == NULL)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s %s, line %d: invalid syntax, missing \"=\"\n"),
|
||||
WEECHAT_WARNING, filename, line_number);
|
||||
@@ -358,7 +358,7 @@ plugin_config_write ()
|
||||
|
||||
if ((file = fopen (filename, "w")) == NULL)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s cannot create file \"%s\"\n"),
|
||||
WEECHAT_ERROR, filename);
|
||||
free (filename);
|
||||
|
||||
@@ -176,7 +176,7 @@ weechat_plugin_print (t_weechat_plugin *plugin,
|
||||
va_end (argptr);
|
||||
|
||||
buf2 = weechat_iconv_to_internal (plugin->charset, buf);
|
||||
irc_display_prefix (NULL, ptr_buffer, PREFIX_PLUGIN);
|
||||
irc_display_prefix (NULL, ptr_buffer, GUI_PREFIX_PLUGIN);
|
||||
gui_printf_keep_colors (ptr_buffer, "%s\n", (buf2) ? buf2 : buf);
|
||||
if (buf2)
|
||||
free (buf2);
|
||||
@@ -201,7 +201,7 @@ weechat_plugin_print_server (t_weechat_plugin *plugin, char *message, ...)
|
||||
va_end (argptr);
|
||||
|
||||
buf2 = weechat_iconv_to_internal (plugin->charset, buf);
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
|
||||
gui_printf_keep_colors (NULL, "%s\n", (buf2) ? buf2 : buf);
|
||||
if (buf2)
|
||||
free (buf2);
|
||||
@@ -226,7 +226,7 @@ weechat_plugin_print_infobar (t_weechat_plugin *plugin, int time_displayed, char
|
||||
va_end (argptr);
|
||||
|
||||
buf2 = weechat_iconv_to_internal (plugin->charset, buf);
|
||||
gui_infobar_printf (time_displayed, COLOR_WIN_INFOBAR, "%s",
|
||||
gui_infobar_printf (time_displayed, GUI_COLOR_WIN_INFOBAR, "%s",
|
||||
(buf2) ? buf2 : buf);
|
||||
if (buf2)
|
||||
free (buf2);
|
||||
@@ -451,7 +451,7 @@ weechat_plugin_exec_command (t_weechat_plugin *plugin,
|
||||
|
||||
if (plugin_find_server_channel (server, channel, &ptr_server, &ptr_channel) < 0)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s server/channel (%s/%s) not found for plugin "
|
||||
"exec command\n"),
|
||||
@@ -577,9 +577,9 @@ weechat_plugin_get_info (t_weechat_plugin *plugin, char *info, char *server)
|
||||
}
|
||||
else if (ascii_strcasecmp (info, "channel") == 0)
|
||||
{
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer)
|
||||
|| BUFFER_IS_PRIVATE(gui_current_window->buffer))
|
||||
return strdup (CHANNEL(gui_current_window->buffer)->name);
|
||||
if (GUI_BUFFER_IS_CHANNEL(gui_current_window->buffer)
|
||||
|| GUI_BUFFER_IS_PRIVATE(gui_current_window->buffer))
|
||||
return strdup (GUI_CHANNEL(gui_current_window->buffer)->name);
|
||||
}
|
||||
else if (ascii_strcasecmp (info, "server") == 0)
|
||||
{
|
||||
@@ -622,11 +622,11 @@ weechat_plugin_get_dcc_info (t_weechat_plugin *plugin)
|
||||
if (!plugin)
|
||||
return NULL;
|
||||
|
||||
if (dcc_list)
|
||||
if (irc_dcc_list)
|
||||
{
|
||||
dcc_info = NULL;
|
||||
last_dcc_info = NULL;
|
||||
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
|
||||
for (ptr_dcc = irc_dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
|
||||
{
|
||||
new_dcc_info = (t_plugin_dcc_info *)malloc (sizeof (t_plugin_dcc_info));
|
||||
if (new_dcc_info)
|
||||
@@ -1331,8 +1331,8 @@ weechat_plugin_get_buffer_info (t_weechat_plugin *plugin)
|
||||
new_buffer_info->type = ptr_buffer->type;
|
||||
new_buffer_info->number = ptr_buffer->number;
|
||||
new_buffer_info->num_displayed = ptr_buffer->num_displayed;
|
||||
new_buffer_info->server_name = (SERVER(ptr_buffer)) ? strdup (SERVER(ptr_buffer)->name) : NULL;
|
||||
new_buffer_info->channel_name = (CHANNEL(ptr_buffer)) ? strdup (CHANNEL(ptr_buffer)->name) : NULL;
|
||||
new_buffer_info->server_name = (GUI_SERVER(ptr_buffer)) ? strdup (GUI_SERVER(ptr_buffer)->name) : NULL;
|
||||
new_buffer_info->channel_name = (GUI_CHANNEL(ptr_buffer)) ? strdup (GUI_CHANNEL(ptr_buffer)->name) : NULL;
|
||||
new_buffer_info->notify_level = ptr_buffer->notify_level;
|
||||
new_buffer_info->log_filename = (ptr_buffer->log_filename) ? strdup (ptr_buffer->log_filename) : NULL;
|
||||
|
||||
|
||||
+28
-28
@@ -81,10 +81,10 @@ plugin_find_server_channel (char *server, char *channel,
|
||||
/* nothing given => return current server/channel */
|
||||
if ((!server || !server[0]) && (!channel || !channel[0]))
|
||||
{
|
||||
(*ptr_server) = SERVER(gui_current_window->buffer);
|
||||
(*ptr_channel) = (BUFFER_IS_CHANNEL(gui_current_window->buffer) ||
|
||||
BUFFER_IS_PRIVATE(gui_current_window->buffer)) ?
|
||||
CHANNEL(gui_current_window->buffer) : NULL;
|
||||
(*ptr_server) = GUI_SERVER(gui_current_window->buffer);
|
||||
(*ptr_channel) = (GUI_BUFFER_IS_CHANNEL(gui_current_window->buffer) ||
|
||||
GUI_BUFFER_IS_PRIVATE(gui_current_window->buffer)) ?
|
||||
GUI_CHANNEL(gui_current_window->buffer) : NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -96,9 +96,9 @@ plugin_find_server_channel (char *server, char *channel,
|
||||
}
|
||||
else
|
||||
{
|
||||
(*ptr_server) = SERVER(gui_current_window->buffer);
|
||||
(*ptr_server) = GUI_SERVER(gui_current_window->buffer);
|
||||
if (!(*ptr_server))
|
||||
(*ptr_server) = SERVER(gui_buffers);
|
||||
(*ptr_server) = GUI_SERVER(gui_buffers);
|
||||
}
|
||||
|
||||
if (channel && channel[0])
|
||||
@@ -238,7 +238,7 @@ plugin_msg_handler_add (t_weechat_plugin *plugin, char *irc_command,
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s plugin %s: unable to add handler for IRC command \"%s\" (not enough memory)\n"),
|
||||
WEECHAT_ERROR, plugin->name, irc_command);
|
||||
@@ -275,7 +275,7 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
|
||||
|
||||
if (plugin_cmd_handler_search (command))
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s plugin %s: unable to add handler for \"%s\" command "
|
||||
"(already exists)\n"),
|
||||
@@ -285,7 +285,7 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
|
||||
|
||||
if (ascii_strcasecmp (command, "builtin") == 0)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s plugin %s: unable to add handler for \"%s\" command "
|
||||
"(forbidden)\n"),
|
||||
@@ -327,7 +327,7 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s plugin %s: unable to add handler for \"%s\" command (not enough memory)\n"),
|
||||
WEECHAT_ERROR, plugin->name, command);
|
||||
@@ -384,7 +384,7 @@ plugin_timer_handler_add (t_weechat_plugin *plugin, int interval,
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s plugin %s: unable to add timer handler (not enough memory)\n"),
|
||||
WEECHAT_ERROR, plugin->name);
|
||||
@@ -440,7 +440,7 @@ plugin_keyboard_handler_add (t_weechat_plugin *plugin,
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s plugin %s: unable to add keyboard handler (not enough memory)\n"),
|
||||
WEECHAT_ERROR, plugin->name);
|
||||
@@ -497,7 +497,7 @@ plugin_event_handler_add (t_weechat_plugin *plugin, char *event,
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s plugin %s: unable to add event handler (not enough memory)\n"),
|
||||
WEECHAT_ERROR, plugin->name);
|
||||
@@ -839,7 +839,7 @@ plugin_modifier_add (t_weechat_plugin *plugin, char *type, char *command,
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s plugin %s: unable to add modifier (not enough memory)\n"),
|
||||
WEECHAT_ERROR, plugin->name);
|
||||
@@ -1072,7 +1072,7 @@ plugin_load (char *filename)
|
||||
handle = dlopen (full_name, RTLD_GLOBAL | RTLD_NOW);
|
||||
if (!handle)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s unable to load plugin \"%s\": %s\n"),
|
||||
WEECHAT_ERROR, full_name, dlerror());
|
||||
free (full_name);
|
||||
@@ -1083,7 +1083,7 @@ plugin_load (char *filename)
|
||||
if (!name)
|
||||
{
|
||||
dlclose (handle);
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s symbol \"plugin_name\" not found in plugin \"%s\", failed to load\n"),
|
||||
WEECHAT_ERROR, full_name);
|
||||
free (full_name);
|
||||
@@ -1093,7 +1093,7 @@ plugin_load (char *filename)
|
||||
if (plugin_search (name))
|
||||
{
|
||||
dlclose (handle);
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unable to load plugin \"%s\": a plugin with "
|
||||
"same name already exists\n"),
|
||||
@@ -1106,7 +1106,7 @@ plugin_load (char *filename)
|
||||
if (!description)
|
||||
{
|
||||
dlclose (handle);
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s symbol \"plugin_description\" not found in plugin \"%s\", failed to load\n"),
|
||||
WEECHAT_ERROR, full_name);
|
||||
free (full_name);
|
||||
@@ -1117,7 +1117,7 @@ plugin_load (char *filename)
|
||||
if (!version)
|
||||
{
|
||||
dlclose (handle);
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s symbol \"plugin_version\" not found in plugin \"%s\", failed to load\n"),
|
||||
WEECHAT_ERROR, full_name);
|
||||
free (full_name);
|
||||
@@ -1130,7 +1130,7 @@ plugin_load (char *filename)
|
||||
if (!init_func)
|
||||
{
|
||||
dlclose (handle);
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL, _("%s function \"weechat_plugin_init\" not found in plugin \"%s\", failed to load\n"),
|
||||
WEECHAT_ERROR, full_name);
|
||||
free (full_name);
|
||||
@@ -1213,7 +1213,7 @@ plugin_load (char *filename)
|
||||
weechat_plugins = new_plugin;
|
||||
last_weechat_plugin = new_plugin;
|
||||
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
|
||||
gui_printf (NULL,
|
||||
_("Initializing plugin \"%s\" %s\n"),
|
||||
new_plugin->name, new_plugin->version);
|
||||
@@ -1221,7 +1221,7 @@ plugin_load (char *filename)
|
||||
/* init plugin */
|
||||
if (((t_weechat_init_func *)init_func) (new_plugin) < 0)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unable to initialize plugin \"%s\"\n"),
|
||||
WEECHAT_ERROR, full_name);
|
||||
@@ -1232,7 +1232,7 @@ plugin_load (char *filename)
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s unable to load plugin \"%s\" (not enough memory)\n"),
|
||||
WEECHAT_ERROR, full_name);
|
||||
@@ -1240,7 +1240,7 @@ plugin_load (char *filename)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
|
||||
gui_printf (NULL,
|
||||
_("Plugin \"%s\" (%s) loaded.\n"),
|
||||
name, full_name);
|
||||
@@ -1415,12 +1415,12 @@ plugin_unload_name (char *name)
|
||||
if (ptr_plugin)
|
||||
{
|
||||
plugin_unload (ptr_plugin);
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
|
||||
gui_printf (NULL, _("Plugin \"%s\" unloaded.\n"), name);
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s plugin \"%s\" not found\n"),
|
||||
WEECHAT_ERROR, name);
|
||||
@@ -1455,7 +1455,7 @@ plugin_reload_name (char *name)
|
||||
if (filename)
|
||||
{
|
||||
plugin_unload (ptr_plugin);
|
||||
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
|
||||
gui_printf (NULL, _("Plugin \"%s\" unloaded.\n"), name);
|
||||
plugin_load (filename);
|
||||
free (filename);
|
||||
@@ -1463,7 +1463,7 @@ plugin_reload_name (char *name)
|
||||
}
|
||||
else
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s plugin \"%s\" not found\n"),
|
||||
WEECHAT_ERROR, name);
|
||||
|
||||
Reference in New Issue
Block a user