1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 08:43:13 +02:00

Added print hooks (to catch any printf on buffers)

This commit is contained in:
Sebastien Helleu
2007-11-07 15:11:06 +01:00
parent dc4f5ea2e2
commit 50889eaf3b
9 changed files with 233 additions and 113 deletions
+8 -5
View File
@@ -402,15 +402,18 @@ plugin_api_hook_command (struct t_weechat_plugin *plugin, char *command,
}
/*
* plugin_api_hook_message: hook a message
* plugin_api_hook_print: hook a printed message
*/
struct t_hook *
plugin_api_hook_message (struct t_weechat_plugin *plugin, char *message,
int (*callback)(void *, char *), void *data)
plugin_api_hook_print (struct t_weechat_plugin *plugin, void *buffer,
char *message,
int (*callback)(void *, void *, time_t, char *, char *),
void *data)
{
if (plugin && callback)
return hook_message (plugin, message, callback, data);
if (plugin && gui_buffer_valid ((struct t_gui_buffer *)buffer)
&& callback)
return hook_print (plugin, buffer, message, callback, data);
return NULL;
}