1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 15:53:12 +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:
Sébastien Helleu
2025-10-12 17:37:24 +02:00
parent 72b2242135
commit f854db17ff
56 changed files with 1655 additions and 21 deletions
+37 -1
View File
@@ -29,9 +29,10 @@
#include <string.h>
#include "../weechat.h"
#include "../core-hook.h"
#include "../core-arraylist.h"
#include "../core-config.h"
#include "../core-hook.h"
#include "../core-hdata.h"
#include "../core-infolist.h"
#include "../core-list.h"
#include "../core-log.h"
@@ -1047,6 +1048,41 @@ hook_command_free_data (struct t_hook *hook)
hook->hook_data = NULL;
}
/*
* Returns hdata for command hook.
*/
struct t_hdata *
hook_command_hdata_hook_command_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_command, callback, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_hook_command, command, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_hook_command, description, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_hook_command, args, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_hook_command, args_description, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_hook_command, completion, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_hook_command, cplt_num_templates, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_hook_command, cplt_templates, POINTER, 0, "*,cplt_num_templates", NULL);
HDATA_VAR(struct t_hook_command, cplt_templates_static, POINTER, 0, "*,cplt_num_templates", NULL);
HDATA_VAR(struct t_hook_command, cplt_template_num_args, INTEGER, 0, "*,cplt_num_templates", NULL);
HDATA_VAR(struct t_hook_command, cplt_template_args, POINTER, 0, "*,cplt_num_templates", NULL);
HDATA_VAR(struct t_hook_command, cplt_template_num_args_concat, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_hook_command, cplt_template_args_concat, POINTER, 0, "*,cplt_template_num_args_concat", NULL);
HDATA_VAR(struct t_hook_command, keep_spaces_right, INTEGER, 0, NULL, NULL);
}
return hdata;
}
/*
* Adds command hook data in the infolist item.
*