diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-03-15 18:34:17 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-03-15 21:32:35 +0100 |
commit | 305b046370f46ef13e3125983a4da0b132e798f1 (patch) | |
tree | 2f2f1ec9e3a04f75cadd2a17596a380a1ca9697a /src/plugins | |
parent | 080eecef2c455524b8cf0b2183a81d06392fd5fb (diff) | |
download | weechat-305b046370f46ef13e3125983a4da0b132e798f1.zip |
core: add macro to define hdata variable with different field and name
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/weechat-plugin.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index fde3a1db4..174eeb641 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -2263,9 +2263,17 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); (weechat_plugin->hdata_new_var)(__hdata, __name, __offset, __type, \ __update_allowed, __array_size, \ __hdata_name) -#define WEECHAT_HDATA_VAR(__struct, __name, __type, __update_allowed, \ +#define WEECHAT_HDATA_VAR(__struct, __field, __type, __update_allowed, \ __array_size, __hdata_name) \ - weechat_hdata_new_var (hdata, #__name, offsetof (__struct, __name), \ + weechat_hdata_new_var (hdata, #__field, \ + offsetof (__struct, __field), \ + WEECHAT_HDATA_##__type, __update_allowed, \ + __array_size, __hdata_name) +#define WEECHAT_HDATA_VAR_NAME(__struct, __field, __name, __type, \ + __update_allowed, __array_size, \ + __hdata_name) \ + weechat_hdata_new_var (hdata, __name, \ + offsetof (__struct, __field), \ WEECHAT_HDATA_##__type, __update_allowed, \ __array_size, __hdata_name) #define weechat_hdata_new_list(__hdata, __name, __pointer, __flags) \ |