1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 06:16:40 +02:00

Added plugin API function to get IRC color number by name

This commit is contained in:
Sebastien Helleu
2006-06-10 18:59:43 +00:00
parent 4e434e4fb3
commit 62059cb614
8 changed files with 108 additions and 0 deletions
+22
View File
@@ -1090,3 +1090,25 @@ weechat_plugin_input_color (t_weechat_plugin *plugin, int color, int start, int
}
}
}
/*
* weechat_plugin_get_irc_color: get number of IRC color name
*/
int
weechat_plugin_get_irc_color (t_weechat_plugin *plugin, char *color_name)
{
int i;
if (!plugin)
return -1;
for (i = 0; i < GUI_NUM_IRC_COLORS; i++)
{
if (strcasecmp (plugins_irc_colors[i].name, color_name) == 0)
return i;
}
/* color not found */
return -1;
}