mirror of
https://github.com/weechat/weechat.git
synced 2026-06-28 13:56:37 +02:00
api: allow creation of structure with hdata_update (allowed for hdata "history")
This commit is contained in:
@@ -895,7 +895,7 @@ irc_channel_hdata_channel_cb (void *data, const char *hdata_name)
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_channel", "next_channel",
|
||||
0, NULL, NULL);
|
||||
0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
WEECHAT_HDATA_VAR(struct t_irc_channel, type, INTEGER, 0, NULL, NULL);
|
||||
@@ -940,7 +940,7 @@ irc_channel_hdata_channel_speaking_cb (void *data, const char *hdata_name)
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_nick", "next_nick",
|
||||
0, NULL, NULL);
|
||||
0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
WEECHAT_HDATA_VAR(struct t_irc_channel_speaking, nick, STRING, 0, NULL, NULL);
|
||||
|
||||
@@ -319,7 +319,7 @@ irc_ignore_hdata_ignore_cb (void *data, const char *hdata_name)
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_ignore", "next_ignore",
|
||||
0, NULL, NULL);
|
||||
0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
WEECHAT_HDATA_VAR(struct t_irc_ignore, number, INTEGER, 0, NULL, NULL);
|
||||
|
||||
@@ -1032,7 +1032,7 @@ irc_nick_hdata_nick_cb (void *data, const char *hdata_name)
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_nick", "next_nick",
|
||||
0, NULL, NULL);
|
||||
0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
WEECHAT_HDATA_VAR(struct t_irc_nick, name, STRING, 0, NULL, NULL);
|
||||
|
||||
@@ -964,7 +964,7 @@ irc_notify_hdata_notify_cb (void *data, const char *hdata_name)
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_notify", "next_notify",
|
||||
0, NULL, NULL);
|
||||
0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
WEECHAT_HDATA_VAR(struct t_irc_notify, server, POINTER, 0, NULL, "irc_server");
|
||||
|
||||
@@ -976,7 +976,7 @@ irc_redirect_hdata_redirect_pattern_cb (void *data, const char *hdata_name)
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_redirect", "next_redirect",
|
||||
0, NULL, NULL);
|
||||
0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, name, STRING, 0, NULL, NULL);
|
||||
@@ -1006,7 +1006,7 @@ irc_redirect_hdata_redirect_cb (void *data, const char *hdata_name)
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_redirect", "next_redirect",
|
||||
0, NULL, NULL);
|
||||
0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
WEECHAT_HDATA_VAR(struct t_irc_redirect, server, POINTER, 0, NULL, "irc_server");
|
||||
|
||||
@@ -4440,7 +4440,7 @@ irc_server_hdata_server_cb (void *data, const char *hdata_name)
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_server", "next_server",
|
||||
0, NULL, NULL);
|
||||
0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
WEECHAT_HDATA_VAR(struct t_irc_server, name, STRING, 0, NULL, NULL);
|
||||
|
||||
@@ -641,7 +641,7 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name,
|
||||
if (ptr_infolist)
|
||||
{
|
||||
for (ptr_history = (pointer) ?
|
||||
((struct t_gui_buffer *)pointer)->history : history_global;
|
||||
((struct t_gui_buffer *)pointer)->history : gui_history;
|
||||
ptr_history; ptr_history = ptr_history->next_history)
|
||||
{
|
||||
if (!gui_history_add_to_infolist (ptr_infolist, ptr_history))
|
||||
|
||||
@@ -1203,7 +1203,7 @@ plugin_script_hdata_script (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_hdata *hdata;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_script", "next_script",
|
||||
0, NULL, NULL);
|
||||
0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
WEECHAT_HDATA_VAR(struct t_plugin_script, filename, STRING, 0, NULL, NULL);
|
||||
|
||||
@@ -1220,7 +1220,7 @@ plugin_hdata_plugin_cb (void *data, const char *hdata_name)
|
||||
(void) data;
|
||||
|
||||
hdata = hdata_new (NULL, hdata_name, "prev_plugin", "next_plugin",
|
||||
0, NULL, NULL);
|
||||
0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
HDATA_VAR(struct t_weechat_plugin, filename, STRING, 0, NULL, NULL);
|
||||
|
||||
@@ -1470,7 +1470,7 @@ script_repo_hdata_script_cb (void *data, const char *hdata_name)
|
||||
(void) data;
|
||||
|
||||
hdata = weechat_hdata_new (hdata_name, "prev_script", "next_script",
|
||||
0, NULL, NULL);
|
||||
0, 0, NULL, NULL);
|
||||
if (hdata)
|
||||
{
|
||||
WEECHAT_HDATA_VAR(struct t_script_repo, name, STRING, 0, NULL, NULL);
|
||||
|
||||
@@ -50,7 +50,7 @@ struct timeval;
|
||||
* please change the date with current one; for a second change at same
|
||||
* date, increment the 01, otherwise please keep 01.
|
||||
*/
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20121102-01"
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20121208-01"
|
||||
|
||||
/* macros for defining plugin infos */
|
||||
#define WEECHAT_PLUGIN_NAME(__name) \
|
||||
@@ -843,7 +843,7 @@ struct t_weechat_plugin
|
||||
struct t_hdata *(*hdata_new) (struct t_weechat_plugin *plugin,
|
||||
const char *hdata_name, const char *var_prev,
|
||||
const char *var_next,
|
||||
int delete_allowed,
|
||||
int create_allowed, int delete_allowed,
|
||||
int (*callback_update)(void *data,
|
||||
struct t_hdata *hdata,
|
||||
void *pointer,
|
||||
@@ -1623,11 +1623,11 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
|
||||
|
||||
/* hdata */
|
||||
#define weechat_hdata_new(__hdata_name, __var_prev, __var_next, \
|
||||
__delete_allowed, __callback_update, \
|
||||
__callback_update_data) \
|
||||
__create_allowed, __delete_allowed, \
|
||||
__callback_update, __callback_update_data) \
|
||||
weechat_plugin->hdata_new(weechat_plugin, __hdata_name, __var_prev, \
|
||||
__var_next, __delete_allowed, \
|
||||
__callback_update, \
|
||||
__var_next, __create_allowed, \
|
||||
__delete_allowed, __callback_update, \
|
||||
__callback_update_data)
|
||||
#define weechat_hdata_new_var(__hdata, __name, __offset, __type, \
|
||||
__update_allowed, __array_size, \
|
||||
|
||||
Reference in New Issue
Block a user