1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 22:36:38 +02:00

api: add argument "flags" in function hdata_new_list

This commit is contained in:
Sébastien Helleu
2014-05-24 18:03:14 +02:00
parent 3092c09bc9
commit 7aaf3be15b
25 changed files with 236 additions and 91 deletions
+2 -2
View File
@@ -326,8 +326,8 @@ irc_ignore_hdata_ignore_cb (void *data, const char *hdata_name)
WEECHAT_HDATA_VAR(struct t_irc_ignore, channel, STRING, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_ignore, prev_ignore, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_VAR(struct t_irc_ignore, next_ignore, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_LIST(irc_ignore_list);
WEECHAT_HDATA_LIST(last_irc_ignore);
WEECHAT_HDATA_LIST(irc_ignore_list, WEECHAT_HDATA_LIST_CHECK_POINTERS);
WEECHAT_HDATA_LIST(last_irc_ignore, 0);
}
return hdata;
}
+2 -2
View File
@@ -1007,8 +1007,8 @@ irc_redirect_hdata_redirect_pattern_cb (void *data, const char *hdata_name)
WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, cmd_extra, STRING, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, prev_redirect, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_VAR(struct t_irc_redirect_pattern, next_redirect, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_LIST(irc_redirect_patterns);
WEECHAT_HDATA_LIST(last_irc_redirect_pattern);
WEECHAT_HDATA_LIST(irc_redirect_patterns, WEECHAT_HDATA_LIST_CHECK_POINTERS);
WEECHAT_HDATA_LIST(last_irc_redirect_pattern, 0);
}
return hdata;
}
+2 -2
View File
@@ -4904,8 +4904,8 @@ irc_server_hdata_server_cb (void *data, const char *hdata_name)
WEECHAT_HDATA_VAR(struct t_irc_server, last_channel, POINTER, 0, NULL, "irc_channel");
WEECHAT_HDATA_VAR(struct t_irc_server, prev_server, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_VAR(struct t_irc_server, next_server, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_LIST(irc_servers);
WEECHAT_HDATA_LIST(last_irc_server);
WEECHAT_HDATA_LIST(irc_servers, WEECHAT_HDATA_LIST_CHECK_POINTERS);
WEECHAT_HDATA_LIST(last_irc_server, 0);
}
return hdata;
}
+3 -2
View File
@@ -1380,8 +1380,9 @@ plugin_script_hdata_script (struct t_weechat_plugin *weechat_plugin,
WEECHAT_HDATA_VAR(struct t_plugin_script, unloading, INTEGER, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_plugin_script, prev_script, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_VAR(struct t_plugin_script, next_script, POINTER, 0, NULL, hdata_name);
weechat_hdata_new_list (hdata, "scripts", scripts);
weechat_hdata_new_list (hdata, "last_script", last_script);
weechat_hdata_new_list (hdata, "scripts", scripts,
WEECHAT_HDATA_LIST_CHECK_POINTERS);
weechat_hdata_new_list (hdata, "last_script", last_script, 0);
}
return hdata;
}
+2 -2
View File
@@ -1247,8 +1247,8 @@ plugin_hdata_plugin_cb (void *data, const char *hdata_name)
HDATA_VAR(struct t_weechat_plugin, debug, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_weechat_plugin, prev_plugin, POINTER, 0, NULL, hdata_name);
HDATA_VAR(struct t_weechat_plugin, next_plugin, POINTER, 0, NULL, hdata_name);
HDATA_LIST(weechat_plugins);
HDATA_LIST(last_weechat_plugin);
HDATA_LIST(weechat_plugins, WEECHAT_HDATA_LIST_CHECK_POINTERS);
HDATA_LIST(last_weechat_plugin, 0);
}
return hdata;
}
+2 -2
View File
@@ -1520,8 +1520,8 @@ script_repo_hdata_script_cb (void *data, const char *hdata_name)
WEECHAT_HDATA_VAR(struct t_script_repo, install_order, INTEGER, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_script_repo, prev_script, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_VAR(struct t_script_repo, next_script, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_LIST(scripts_repo);
WEECHAT_HDATA_LIST(last_script_repo);
WEECHAT_HDATA_LIST(scripts_repo, WEECHAT_HDATA_LIST_CHECK_POINTERS);
WEECHAT_HDATA_LIST(last_script_repo, 0);
}
return hdata;
}
+9 -6
View File
@@ -57,7 +57,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 "20140313-01"
#define WEECHAT_PLUGIN_API_VERSION "20140524-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -125,6 +125,9 @@ struct timeval;
#define WEECHAT_HDATA_HASHTABLE 7
#define WEECHAT_HDATA_SHARED_STRING 8
/* flags for hdata lists */
#define WEECHAT_HDATA_LIST_CHECK_POINTERS 1
/* buffer hotlist */
#define WEECHAT_HOTLIST_LOW "0"
#define WEECHAT_HOTLIST_MESSAGE "1"
@@ -879,7 +882,7 @@ struct t_weechat_plugin
int type, int update_allowed, const char *array_size,
const char *hdata_name);
void (*hdata_new_list) (struct t_hdata *hdata, const char *name,
void *pointer);
void *pointer, int flags);
struct t_hdata *(*hdata_get) (struct t_weechat_plugin *plugin,
const char *hdata_name);
int (*hdata_get_var_offset) (struct t_hdata *hdata, const char *name);
@@ -1685,10 +1688,10 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
weechat_hdata_new_var (hdata, #__name, offsetof (__struct, __name), \
WEECHAT_HDATA_##__type, __update_allowed, \
__array_size, __hdata_name)
#define weechat_hdata_new_list(__hdata, __name, __pointer) \
weechat_plugin->hdata_new_list(__hdata, __name, __pointer)
#define WEECHAT_HDATA_LIST(__name) \
weechat_hdata_new_list (hdata, #__name, &(__name));
#define weechat_hdata_new_list(__hdata, __name, __pointer, __flags) \
weechat_plugin->hdata_new_list(__hdata, __name, __pointer, __flags)
#define WEECHAT_HDATA_LIST(__name, __flags) \
weechat_hdata_new_list (hdata, #__name, &(__name), __flags);
#define weechat_hdata_get(__hdata_name) \
weechat_plugin->hdata_get(weechat_plugin, __hdata_name)
#define weechat_hdata_get_var_offset(__hdata, __name) \