1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00

Add filter with third argument of infolist_get for some infolists (bars, bar items, buffers, filters, plugins, irc_server, alias, script list)

This commit is contained in:
Sebastien Helleu
2009-04-24 18:59:22 +02:00
parent e3d2728571
commit 9303884613
13 changed files with 90 additions and 45 deletions
+2 -2
View File
@@ -473,7 +473,6 @@ weechat_lua_infolist_cb (void *data, const char *infolist_name,
{
/* make C compiler happy */
(void) data;
(void) arguments;
if (!infolist_name || !infolist_name[0])
return NULL;
@@ -481,7 +480,8 @@ weechat_lua_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "lua_script") == 0)
{
return script_infolist_list_scripts (weechat_lua_plugin,
lua_scripts, pointer);
lua_scripts, pointer,
arguments);
}
return NULL;
+2 -2
View File
@@ -619,7 +619,6 @@ weechat_perl_infolist_cb (void *data, const char *infolist_name,
{
/* make C compiler happy */
(void) data;
(void) arguments;
if (!infolist_name || !infolist_name[0])
return NULL;
@@ -627,7 +626,8 @@ weechat_perl_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "perl_script") == 0)
{
return script_infolist_list_scripts (weechat_perl_plugin,
perl_scripts, pointer);
perl_scripts, pointer,
arguments);
}
return NULL;
+2 -2
View File
@@ -704,7 +704,6 @@ weechat_python_infolist_cb (void *data, const char *infolist_name,
{
/* make C compiler happy */
(void) data;
(void) arguments;
if (!infolist_name || !infolist_name[0])
return NULL;
@@ -712,7 +711,8 @@ weechat_python_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "python_script") == 0)
{
return script_infolist_list_scripts (weechat_python_plugin,
python_scripts, pointer);
python_scripts, pointer,
arguments);
}
return NULL;
+2 -2
View File
@@ -672,7 +672,6 @@ weechat_ruby_infolist_cb (void *data, const char *infolist_name,
{
/* make C compiler happy */
(void) data;
(void) arguments;
if (!infolist_name || !infolist_name[0])
return NULL;
@@ -680,7 +679,8 @@ weechat_ruby_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "ruby_script") == 0)
{
return script_infolist_list_scripts (weechat_ruby_plugin,
ruby_scripts, pointer);
ruby_scripts, pointer,
arguments);
}
return NULL;
+11 -6
View File
@@ -1161,7 +1161,8 @@ script_add_to_infolist (struct t_weechat_plugin *weechat_plugin,
struct t_infolist *
script_infolist_list_scripts (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
void *pointer)
void *pointer,
const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_plugin_script *ptr_script;
@@ -1185,15 +1186,19 @@ script_infolist_list_scripts (struct t_weechat_plugin *weechat_plugin,
}
else
{
/* build list with all scripts */
/* build list with all scripts matching arguments */
for (ptr_script = scripts; ptr_script;
ptr_script = ptr_script->next_script)
{
if (!script_add_to_infolist (weechat_plugin,
ptr_infolist, ptr_script))
if (!arguments || !arguments[0]
|| weechat_string_match (ptr_script->name, arguments, 0))
{
weechat_infolist_free (ptr_infolist);
return NULL;
if (!script_add_to_infolist (weechat_plugin,
ptr_infolist, ptr_script))
{
weechat_infolist_free (ptr_infolist);
return NULL;
}
}
}
return ptr_infolist;
+2 -1
View File
@@ -137,7 +137,8 @@ extern int script_add_to_infolist (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script);
extern struct t_infolist *script_infolist_list_scripts (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
void *pointer);
void *pointer,
const char *arguments);
extern void script_print_log (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts);
+2 -2
View File
@@ -414,7 +414,6 @@ weechat_tcl_infolist_cb (void *data, const char *infolist_name,
{
/* make C compiler happy */
(void) data;
(void) arguments;
if (!infolist_name || !infolist_name[0])
return NULL;
@@ -422,7 +421,8 @@ weechat_tcl_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "tcl_script") == 0)
{
return script_infolist_list_scripts (weechat_tcl_plugin,
tcl_scripts, pointer);
tcl_scripts, pointer,
arguments);
}
return NULL;