mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 09:43:13 +02:00
core: add hdata for hooks
New hooks: - hook - hook_command - hook_command_run - hook_completion - hook_config - hook_connect - hook_fd - hook_focus - hook_hdata - hook_hsignal - hook_info - hook_info_hashtable - hook_infolist - hook_line - hook_modifier - hook_print - hook_process - hook_signal - hook_timer - hook_url New lists (for hooks of type "hook"): - weechat_hooks_command, last_weechat_hook_command - weechat_hooks_command_run, last_weechat_hook_command_run - weechat_hooks_completion, last_weechat_hook_completion - weechat_hooks_config, last_weechat_hook_config - weechat_hooks_connect, last_weechat_hook_connect - weechat_hooks_fd, last_weechat_hook_fd - weechat_hooks_focus, last_weechat_hook_focus - weechat_hooks_hdata, last_weechat_hook_hdata - weechat_hooks_hsignal, last_weechat_hook_hsignal - weechat_hooks_info, last_weechat_hook_info - weechat_hooks_info_hashtable, last_weechat_hook_info_hashtable - weechat_hooks_infolist, last_weechat_hook_infolist - weechat_hooks_line, last_weechat_hook_line - weechat_hooks_modifier, last_weechat_hook_modifier - weechat_hooks_print, last_weechat_hook_print - weechat_hooks_process, last_weechat_hook_process - weechat_hooks_signal, last_weechat_hook_signal - weechat_hooks_timer, last_weechat_hook_timer - weechat_hooks_url, last_weechat_hook_url
This commit is contained in:
@@ -34,8 +34,9 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "../weechat.h"
|
||||
#include "../core-hashtable.h"
|
||||
#include "../core-hook.h"
|
||||
#include "../core-hashtable.h"
|
||||
#include "../core-hdata.h"
|
||||
#include "../core-infolist.h"
|
||||
#include "../core-log.h"
|
||||
#include "../core-string.h"
|
||||
@@ -914,6 +915,40 @@ hook_process_free_data (struct t_hook *hook)
|
||||
hook->hook_data = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns hdata for process hook.
|
||||
*/
|
||||
|
||||
struct t_hdata *
|
||||
hook_process_hdata_hook_process_cb (const void *pointer, void *data,
|
||||
const char *hdata_name)
|
||||
{
|
||||
struct t_hdata *hdata;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) pointer;
|
||||
(void) data;
|
||||
|
||||
hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
HDATA_VAR(struct t_hook_process, callback, POINTER, 0, NULL, NULL);
|
||||
HDATA_VAR(struct t_hook_process, command, STRING, 0, NULL, NULL);
|
||||
HDATA_VAR(struct t_hook_process, options, HASHTABLE, 0, NULL, NULL);
|
||||
HDATA_VAR(struct t_hook_process, detached, INTEGER, 0, NULL, NULL);
|
||||
HDATA_VAR(struct t_hook_process, timeout, LONG, 0, NULL, NULL);
|
||||
HDATA_VAR(struct t_hook_process, child_read, INTEGER, 0, "3", NULL);
|
||||
HDATA_VAR(struct t_hook_process, child_write, INTEGER, 0, "3", NULL);
|
||||
HDATA_VAR(struct t_hook_process, child_pid, INTEGER, 0, NULL, NULL);
|
||||
HDATA_VAR(struct t_hook_process, hook_fd, POINTER, 0, "3", "hook");
|
||||
HDATA_VAR(struct t_hook_process, hook_timer, POINTER, 0, NULL, "hook");
|
||||
HDATA_VAR(struct t_hook_process, buffer, STRING, 0, "3", NULL);
|
||||
HDATA_VAR(struct t_hook_process, buffer_size, INTEGER, 0, "3", NULL);
|
||||
HDATA_VAR(struct t_hook_process, buffer_flush, INTEGER, 0, NULL, NULL);
|
||||
}
|
||||
return hdata;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds process hook data in the infolist item.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user