summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2007-12-13 11:47:12 +0100
committerSebastien Helleu <flashcode@flashtux.org>2007-12-13 11:47:12 +0100
commit2e74526bb9691389160b8174a69f272c4c3fc1e2 (patch)
tree8f27fee7f436113971d5deaf1dfb40f8b742ac87
parent7a8fb5b2da202562b67c81fd9f08a731ba3eb024 (diff)
downloadweechat-2e74526bb9691389160b8174a69f272c4c3fc1e2.zip
Renamed hook "event" to "signal"
-rw-r--r--ChangeLog4
-rw-r--r--src/core/wee-command.c20
-rw-r--r--src/core/wee-hook.c56
-rw-r--r--src/core/wee-hook.h18
-rw-r--r--src/core/weechat.c2
-rw-r--r--src/gui/gui-buffer.c6
-rw-r--r--src/plugins/alias/alias.c8
-rw-r--r--src/plugins/demo/demo.c10
-rw-r--r--src/plugins/irc/irc.c18
-rw-r--r--src/plugins/logger/logger.c62
-rw-r--r--src/plugins/plugin-api.c12
-rw-r--r--src/plugins/plugin-api.h6
-rw-r--r--src/plugins/plugin.c2
-rw-r--r--src/plugins/weechat-plugin.h9
14 files changed, 123 insertions, 110 deletions
diff --git a/ChangeLog b/ChangeLog
index 69f9f8de6..c1fc74db1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,14 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2007-12-03
+ChangeLog - 2007-12-13
Version 0.2.7 (under dev!):
* added /reload command to reload WeeChat and plugins config files
* new plugins: IRC, alias, demo, fifo, logger, trigger
+ * added hooks: command, timer, file descriptor, print, signal, config,
+ completion
* new plugin API with many new functions: hooks, buffer management,
config files, lists
* new display engine, with prefix and message for each line
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index d0b93696a..c2b9b9d78 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -992,21 +992,21 @@ command_plugin_list (char *name, int full)
}
}
- /* events hooked */
+ /* signals hooked */
hook_found = 0;
for (ptr_hook = weechat_hooks; ptr_hook;
ptr_hook = ptr_hook->next_hook)
{
if ((ptr_hook->plugin == ptr_plugin)
- && (ptr_hook->type == HOOK_TYPE_EVENT))
+ && (ptr_hook->type == HOOK_TYPE_SIGNAL))
{
if (!hook_found)
- gui_chat_printf (NULL, _(" events hooked:"));
+ gui_chat_printf (NULL, _(" signals hooked:"));
hook_found = 1;
gui_chat_printf (NULL,
- _(" event: %s"),
- HOOK_EVENT(ptr_hook, event) ?
- HOOK_EVENT(ptr_hook, event) : _("(all)"));
+ _(" signal: %s"),
+ HOOK_SIGNAL(ptr_hook, signal) ?
+ HOOK_SIGNAL(ptr_hook, signal) : _("(all)"));
}
}
@@ -1139,9 +1139,9 @@ command_quit (void *data, void *buffer,
(void) argc;
(void) argv;
- hook_event_exec ("quit",
- (argc > 1) ?
- argv_eol[1] : CONFIG_STRING(config_look_default_msg_quit));
+ hook_signal_exec ("quit",
+ (argc > 1) ?
+ argv_eol[1] : CONFIG_STRING(config_look_default_msg_quit));
quit_weechat = 1;
@@ -1184,7 +1184,7 @@ command_reload (void *data, void *buffer,
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
/* tell to plugins to reload their configuration */
- (void) hook_event_exec ("config_reload", NULL);
+ hook_signal_exec ("config_reload", NULL);
return WEECHAT_RC_OK;
}
diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c
index 3f21e2e26..d5d7fcc38 100644
--- a/src/core/wee-hook.c
+++ b/src/core/wee-hook.c
@@ -679,34 +679,34 @@ hook_print_exec (void *buffer, time_t date, char *prefix, char *message)
}
/*
- * hook_event: hook an event
+ * hook_signal: hook a signal
*/
struct t_hook *
-hook_event (void *plugin, char *event,
- t_hook_callback_event *callback, void *callback_data)
+hook_signal (void *plugin, char *signal,
+ t_hook_callback_signal *callback, void *callback_data)
{
struct t_hook *new_hook;
- struct t_hook_event *new_hook_event;
+ struct t_hook_signal *new_hook_signal;
- if (!event || !event[0])
+ if (!signal || !signal[0])
return NULL;
new_hook = (struct t_hook *)malloc (sizeof (struct t_hook));
if (!new_hook)
return NULL;
- new_hook_event = (struct t_hook_event *)malloc (sizeof (struct t_hook_event));
- if (!new_hook_event)
+ new_hook_signal = (struct t_hook_signal *)malloc (sizeof (struct t_hook_signal));
+ if (!new_hook_signal)
{
free (new_hook);
return NULL;
}
- hook_init (new_hook, plugin, HOOK_TYPE_EVENT, callback_data);
+ hook_init (new_hook, plugin, HOOK_TYPE_SIGNAL, callback_data);
- new_hook->hook_data = new_hook_event;
- new_hook_event->callback = callback;
- new_hook_event->event = strdup (event);
+ new_hook->hook_data = new_hook_signal;
+ new_hook_signal->callback = callback;
+ new_hook_signal->signal = strdup (signal);
hook_add_to_list (new_hook);
@@ -714,11 +714,11 @@ hook_event (void *plugin, char *event,
}
/*
- * hook_event_exec: execute event hook
+ * hook_signal_exec: execute signal hook
*/
void
-hook_event_exec (char *event, void *pointer)
+hook_signal_exec (char *signal, void *pointer)
{
struct t_hook *ptr_hook, *next_hook;
@@ -729,15 +729,15 @@ hook_event_exec (char *event, void *pointer)
{
next_hook = ptr_hook->next_hook;
- if ((ptr_hook->type == HOOK_TYPE_EVENT)
+ if ((ptr_hook->type == HOOK_TYPE_SIGNAL)
&& (!ptr_hook->running)
- && ((string_strcasecmp (HOOK_EVENT(ptr_hook, event), "*") == 0)
- || (string_strcasecmp (HOOK_EVENT(ptr_hook, event), event) == 0)))
+ && ((string_strcasecmp (HOOK_SIGNAL(ptr_hook, signal), "*") == 0)
+ || (string_strcasecmp (HOOK_SIGNAL(ptr_hook, signal), signal) == 0)))
{
ptr_hook->running = 1;
- (void) (HOOK_EVENT(ptr_hook, callback))
- (ptr_hook->callback_data, event, pointer);
- if (ptr_hook->type == HOOK_TYPE_EVENT)
+ (void) (HOOK_SIGNAL(ptr_hook, callback))
+ (ptr_hook->callback_data, signal, pointer);
+ if (ptr_hook->type == HOOK_TYPE_SIGNAL)
ptr_hook->running = 0;
}
@@ -958,10 +958,10 @@ unhook (struct t_hook *hook)
free (HOOK_PRINT(hook, message));
free ((struct t_hook_print *)hook->hook_data);
break;
- case HOOK_TYPE_EVENT:
- if (HOOK_EVENT(hook, event))
- free (HOOK_EVENT(hook, event));
- free ((struct t_hook_event *)hook->hook_data);
+ case HOOK_TYPE_SIGNAL:
+ if (HOOK_SIGNAL(hook, signal))
+ free (HOOK_SIGNAL(hook, signal));
+ free ((struct t_hook_signal *)hook->hook_data);
break;
case HOOK_TYPE_CONFIG:
if (HOOK_CONFIG(hook, type))
@@ -1087,12 +1087,12 @@ hook_print_log ()
log_printf (" buffer . . . . . . . : 0x%X", HOOK_PRINT(ptr_hook, buffer));
log_printf (" message. . . . . . . : '%s'", HOOK_PRINT(ptr_hook, message));
break;
- case HOOK_TYPE_EVENT:
- log_printf (" type . . . . . . . . . : %d (event)", ptr_hook->type);
+ case HOOK_TYPE_SIGNAL:
+ log_printf (" type . . . . . . . . . : %d (signal)", ptr_hook->type);
log_printf (" callback_data. . . . . : 0x%X", ptr_hook->callback_data);
- log_printf (" event data:");
- log_printf (" callback . . . . . . : 0x%X", HOOK_EVENT(ptr_hook, callback));
- log_printf (" event. . . . . . . . : '%s'", HOOK_EVENT(ptr_hook, event));
+ log_printf (" signal data:");
+ log_printf (" callback . . . . . . : 0x%X", HOOK_SIGNAL(ptr_hook, callback));
+ log_printf (" signal . . . . . . . : '%s'", HOOK_SIGNAL(ptr_hook, signal));
break;
case HOOK_TYPE_CONFIG:
log_printf (" type . . . . . . . . . : %d (config)", ptr_hook->type);
diff --git a/src/core/wee-hook.h b/src/core/wee-hook.h
index 72f69e062..caeb5b822 100644
--- a/src/core/wee-hook.h
+++ b/src/core/wee-hook.h
@@ -29,7 +29,7 @@ enum t_hook_type
HOOK_TYPE_TIMER, /* timer */
HOOK_TYPE_FD, /* socket of file descriptor */
HOOK_TYPE_PRINT, /* printed message */
- HOOK_TYPE_EVENT, /* event */
+ HOOK_TYPE_SIGNAL, /* signal */
HOOK_TYPE_CONFIG, /* config option */
HOOK_TYPE_COMPLETION, /* custom completions */
};
@@ -42,7 +42,7 @@ enum t_hook_type
#define HOOK_TIMER(hook, var) (((struct t_hook_timer *)hook->hook_data)->var)
#define HOOK_FD(hook, var) (((struct t_hook_fd *)hook->hook_data)->var)
#define HOOK_PRINT(hook, var) (((struct t_hook_print *)hook->hook_data)->var)
-#define HOOK_EVENT(hook, var) (((struct t_hook_event *)hook->hook_data)->var)
+#define HOOK_SIGNAL(hook, var) (((struct t_hook_signal *)hook->hook_data)->var)
#define HOOK_CONFIG(hook, var) (((struct t_hook_config *)hook->hook_data)->var)
#define HOOK_COMPLETION(hook, var) (((struct t_hook_completion *)hook->hook_data)->var)
@@ -105,12 +105,12 @@ struct t_hook_print
int strip_colors; /* strip colors in msg for callback? */
};
-typedef int (t_hook_callback_event)(void *, char *, void *);
+typedef int (t_hook_callback_signal)(void *, char *, void *);
-struct t_hook_event
+struct t_hook_signal
{
- t_hook_callback_event *callback; /* event callback */
- char *event; /* event selected ("*" = any event) */
+ t_hook_callback_signal *callback; /* signal callback */
+ char *signal; /* signal selected ("*" = any signal)*/
};
typedef int (t_hook_callback_config)(void *, char *, char *, char *);
@@ -153,9 +153,9 @@ extern void hook_fd_exec (fd_set *, fd_set *, fd_set *);
extern struct t_hook *hook_print (void *, void *, char *, int,
t_hook_callback_print *, void *);
extern void hook_print_exec (void *, time_t, char *, char *);
-extern struct t_hook *hook_event (void *, char *,
- t_hook_callback_event *, void *);
-extern void hook_event_exec (char *, void *);
+extern struct t_hook *hook_signal (void *, char *,
+ t_hook_callback_signal *, void *);
+extern void hook_signal_exec (char *, void *);
extern struct t_hook *hook_config (void *, char *, char *,
t_hook_callback_config *, void *);
extern void hook_config_exec (char *, char *, char *);
diff --git a/src/core/weechat.c b/src/core/weechat.c
index 9d35b02b1..bbbea7fec 100644
--- a/src/core/weechat.c
+++ b/src/core/weechat.c
@@ -521,7 +521,7 @@ weechat_dump (int crash)
plugin_print_log ();
- hook_event_exec ("dump_data", NULL);
+ hook_signal_exec ("dump_data", NULL);
log_printf ("");
log_printf ("****** End of WeeChat dump ******");
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index 390eca487..c88c38f30 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -174,7 +174,7 @@ gui_buffer_new (void *plugin, char *category, char *name,
gui_window_redraw_buffer (new_buffer);
}
- (void) hook_event_exec ("buffer_open", new_buffer);
+ hook_signal_exec ("buffer_open", new_buffer);
}
else
return NULL;
@@ -582,7 +582,7 @@ gui_buffer_free (struct t_gui_buffer *buffer, int switch_to_another)
struct t_gui_buffer *ptr_buffer;
struct t_gui_line *ptr_line;
- (void) hook_event_exec ("buffer_close", buffer);
+ hook_signal_exec ("buffer_close", buffer);
if (switch_to_another)
{
@@ -888,7 +888,7 @@ gui_buffer_move_to_number (struct t_gui_buffer *buffer, int number)
argv[0] = buf1_str;
argv[1] = buf2_str;
/* TODO: send buffer_move event */
- /*(void) plugin_event_handler_exec ("buffer_move", 2, argv);*/
+ /*plugin_event_handler_exec ("buffer_move", 2, argv);*/
}
/*
diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c
index 432d0480f..0908832da 100644
--- a/src/plugins/alias/alias.c
+++ b/src/plugins/alias/alias.c
@@ -533,15 +533,15 @@ alias_config_read ()
}
/*
- * alias_config_reaload_event_cb: reload alias configuration file
+ * alias_config_reaload_signal_cb: reload alias configuration file
*/
int
-alias_config_reload_event_cb (void *data, char *event, void *pointer)
+alias_config_reload_signal_cb (void *data, char *signal, void *pointer)
{
/* make C compiler happy */
(void) data;
- (void) event;
+ (void) signal;
(void) pointer;
alias_free_all ();
@@ -750,7 +750,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
"%(alias)",
&unalias_command_cb, NULL);
- weechat_hook_event ("config_reload", &alias_config_reload_event_cb, NULL);
+ weechat_hook_signal ("config_reload", &alias_config_reload_signal_cb, NULL);
weechat_hook_completion ("alias", &alias_completion_cb, NULL);
diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c
index 5a87ff3c4..186f95218 100644
--- a/src/plugins/demo/demo.c
+++ b/src/plugins/demo/demo.c
@@ -254,18 +254,18 @@ demo_info_command_cb (void *data, void *buffer, int argc, char **argv,
}
/*
- * demo_event_cb: callback for event hook
+ * demo_signal_cb: callback for signal hook
*/
int
-demo_event_cb (void *data, char *event, void *pointer)
+demo_signal_cb (void *data, char *signal, void *pointer)
{
/* make C compiler happy */
(void) data;
weechat_printf (NULL,
- _("demo_event: event: %s, pointer: %X"),
- event, pointer);
+ _("demo_signal: signal: %s, pointer: %X"),
+ signal, pointer);
return WEECHAT_RC_OK;
}
@@ -313,7 +313,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
"inactivity|input|input_mask|input_pos",
&demo_info_command_cb, NULL);
- weechat_hook_event ("*", &demo_event_cb, NULL);
+ weechat_hook_signal ("*", &demo_signal_cb, NULL);
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/irc/irc.c b/src/plugins/irc/irc.c
index 89f5e0c75..ab99c55dc 100644
--- a/src/plugins/irc/irc.c
+++ b/src/plugins/irc/irc.c
@@ -58,7 +58,7 @@ gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
*/
int
-irc_dump_data_cb (void *data, char *event, void *pointer)
+irc_dump_data_cb (void *data, char *signal, void *pointer)
{
struct t_irc_server *ptr_server;
struct t_irc_channel *ptr_channel;
@@ -66,7 +66,7 @@ irc_dump_data_cb (void *data, char *event, void *pointer)
/* make C compiler happy */
(void) data;
- (void) event;
+ (void) signal;
(void) pointer;
weechat_log_printf ("");
@@ -125,17 +125,17 @@ irc_create_directories ()
}
/*
- * irc_quit_cb: callback for event "quit"
+ * irc_quit_cb: callback for "quit" signal
*/
int
-irc_quit_cb (void *data, char *event, void *pointer)
+irc_quit_cb (void *data, char *signal, void *pointer)
{
struct t_irc_server *ptr_server;
/* make C compiler happy */
(void) data;
- (void) event;
+ (void) signal;
(void) pointer;
for (ptr_server = irc_servers; ptr_server;
@@ -174,10 +174,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
irc_command_init ();
- /* hook events */
- weechat_hook_event ("dump_data", &irc_dump_data_cb, NULL);
- weechat_hook_event ("config_reload", &irc_config_reload_cb, NULL);
- weechat_hook_event ("quit", &irc_quit_cb, NULL);
+ /* hook signals */
+ weechat_hook_signal ("dump_data", &irc_dump_data_cb, NULL);
+ weechat_hook_signal ("config_reload", &irc_config_reload_cb, NULL);
+ weechat_hook_signal ("quit", &irc_quit_cb, NULL);
/* hook completions */
weechat_hook_completion ("irc_server", &irc_completion_server_cb, NULL);
diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c
index e68a313e9..7a0eb8041 100644
--- a/src/plugins/logger/logger.c
+++ b/src/plugins/logger/logger.c
@@ -45,15 +45,15 @@ char plugin_description[] = "Logger plugin for WeeChat";
struct t_weechat_plugin *weechat_logger_plugin = NULL;
#define weechat_plugin weechat_logger_plugin
-static char *logger_path = NULL;
-static char *logger_time_format = NULL;
+char *logger_path = NULL;
+char *logger_time_format = NULL;
/*
* logger_config_read: read config options for logger plugin
*/
-static void
+void
logger_config_read ()
{
if (logger_path)
@@ -80,7 +80,7 @@ logger_config_read ()
* return 1 if success, 0 if failed
*/
-static int
+int
logger_create_directory ()
{
int rc;
@@ -99,8 +99,7 @@ logger_create_directory ()
{
if (mkdir (dir2, 0755) < 0)
{
- if (errno != EEXIST)
- rc = 0;
+ if (errno != EEXIST) rc = 0;
}
else
chmod (dir2, 0700);
@@ -124,7 +123,7 @@ logger_create_directory ()
* logger_get_filename: build log filename for a buffer
*/
-static char *
+char *
logger_get_filename (void *buffer)
{
struct t_plugin_infolist *ptr_infolist;
@@ -202,7 +201,7 @@ logger_get_filename (void *buffer)
* logger_write_line: write a line to log file
*/
-static void
+void
logger_write_line (struct t_logger_buffer *logger_buffer, char *format, ...)
{
va_list argptr;
@@ -270,7 +269,7 @@ logger_write_line (struct t_logger_buffer *logger_buffer, char *format, ...)
* logger_start_buffer: start a log for a buffer
*/
-static void
+void
logger_start_buffer (void *buffer)
{
struct t_logger_buffer *ptr_logger_buffer;
@@ -305,7 +304,7 @@ logger_start_buffer (void *buffer)
* logger_start_buffer_all: start log buffer for all buffers
*/
-static void
+void
logger_start_buffer_all ()
{
struct t_plugin_infolist *ptr_infolist;
@@ -322,7 +321,7 @@ logger_start_buffer_all ()
* logger_end: end log for a logger buffer
*/
-static void
+void
logger_end (struct t_logger_buffer *logger_buffer)
{
time_t seconds;
@@ -353,7 +352,7 @@ logger_end (struct t_logger_buffer *logger_buffer)
* logger_end_all: end log for all buffers
*/
-static void
+void
logger_end_all ()
{
struct t_logger_buffer *ptr_logger_buffer;
@@ -366,24 +365,35 @@ logger_end_all ()
}
/*
- * logger_event_cb: callback for event hook
+ * logger_buffer_open_signal_cb: callback for buffer_open signal
*/
-static int
-logger_event_cb (void *data, char *event, void *pointer)
+int
+logger_buffer_open_signal_cb (void *data, char *signal, void *pointer)
{
/* make C compiler happy */
(void) data;
+ (void) signal;
(void) pointer;
- if (weechat_strcasecmp (event, "buffer_open") == 0)
- {
- logger_start_buffer (pointer);
- }
- else if (weechat_strcasecmp (event, "buffer_close") == 0)
- {
- logger_end (logger_buffer_search (pointer));
- }
+ logger_start_buffer (pointer);
+
+ return WEECHAT_RC_OK;
+}
+
+/*
+ * logger_buffer_close_signal_cb: callback for buffer_close signal
+ */
+
+int
+logger_buffer_close_signal_cb (void *data, char *signal, void *pointer)
+{
+ /* make C compiler happy */
+ (void) data;
+ (void) signal;
+ (void) pointer;
+
+ logger_end (logger_buffer_search (pointer));
return WEECHAT_RC_OK;
}
@@ -392,7 +402,7 @@ logger_event_cb (void *data, char *event, void *pointer)
* logger_print_cb: callback for print hook
*/
-static int
+int
logger_print_cb (void *data, void *buffer, time_t date, char *prefix,
char *message)
{
@@ -441,8 +451,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
logger_start_buffer_all ();
- weechat_hook_event ("buffer_open", &logger_event_cb, NULL);
- weechat_hook_event ("buffer_close", &logger_event_cb, NULL);
+ weechat_hook_signal ("buffer_open", &logger_buffer_open_signal_cb, NULL);
+ weechat_hook_signal ("buffer_close", &logger_buffer_close_signal_cb, NULL);
weechat_hook_print (NULL, NULL, 1, &logger_print_cb, NULL);
diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c
index f957b7b2d..968cf0dc7 100644
--- a/src/plugins/plugin-api.c
+++ b/src/plugins/plugin-api.c
@@ -1367,16 +1367,16 @@ plugin_api_hook_print (struct t_weechat_plugin *plugin, void *buffer,
}
/*
- * plugin_api_hook_event: hook an event
+ * plugin_api_hook_signal: hook a signal
*/
struct t_hook *
-plugin_api_hook_event (struct t_weechat_plugin *plugin, char *event,
- int (*callback)(void *, char *, void *),
- void *data)
+plugin_api_hook_signal (struct t_weechat_plugin *plugin, char *signal,
+ int (*callback)(void *, char *, void *),
+ void *data)
{
- if (plugin && event && event[0] && callback)
- return hook_event (plugin, event, callback, data);
+ if (plugin && signal && signal[0] && callback)
+ return hook_signal (plugin, signal, callback, data);
return NULL;
}
diff --git a/src/plugins/plugin-api.h b/src/plugins/plugin-api.h
index e67cd0680..39b2a7748 100644
--- a/src/plugins/plugin-api.h
+++ b/src/plugins/plugin-api.h
@@ -156,9 +156,9 @@ extern struct t_hook *plugin_api_hook_print (struct t_weechat_plugin *,
void *, char *, int,
int (*)(void *, void *, time_t, char *, char *),
void *);
-extern struct t_hook *plugin_api_hook_event (struct t_weechat_plugin *, char *,
- int (*)(void *, char *, void *),
- void *);
+extern struct t_hook *plugin_api_hook_signal (struct t_weechat_plugin *, char *,
+ int (*)(void *, char *, void *),
+ void *);
extern struct t_hook *plugin_api_hook_config (struct t_weechat_plugin *,
char *, char *,
int (*)(void *, char *, char *, char *),
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index a625a1eb5..b231b6e24 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -303,7 +303,7 @@ plugin_load (char *filename)
new_plugin->hook_timer = &plugin_api_hook_timer;
new_plugin->hook_fd = &plugin_api_hook_fd;
new_plugin->hook_print = &plugin_api_hook_print;
- new_plugin->hook_event = &plugin_api_hook_event;
+ new_plugin->hook_signal = &plugin_api_hook_signal;
new_plugin->hook_config = &plugin_api_hook_config;
new_plugin->hook_completion = &plugin_api_hook_completion;
new_plugin->unhook = &plugin_api_unhook;
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 136fade94..81117665c 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -168,8 +168,8 @@ struct t_weechat_plugin
int,
int (*)(void *, void *, time_t, char *, char *),
void *);
- struct t_hook *(*hook_event) (struct t_weechat_plugin *, char *,
- int (*)(void *, char *, void *), void *);
+ struct t_hook *(*hook_signal) (struct t_weechat_plugin *, char *,
+ int (*)(void *, char *, void *), void *);
struct t_hook *(*hook_config) (struct t_weechat_plugin *, char *, char *,
int (*)(void *, char *, char *, char *),
void *);
@@ -418,8 +418,9 @@ struct t_weechat_plugin
__data) \
weechat_plugin->hook_print(weechat_plugin, __buffer, __msg, \
__stri__colors, __callback, __data)
-#define weechat_hook_event(__event, __callback, __data) \
- weechat_plugin->hook_event(weechat_plugin, __event, __callback, __data)
+#define weechat_hook_signal(__signal, __callback, __data) \
+ weechat_plugin->hook_signal(weechat_plugin, __signal, __callback, \
+ __data)
#define weechat_hook_config(__type, __option, __callback, __data) \
weechat_plugin->hook_config(weechat_plugin, __type, __option, \
__callback, __data)