summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-11-30 08:59:27 +0100
committerSébastien Helleu <flashcode@flashtux.org>2014-11-30 08:59:27 +0100
commit01c6fb55668f7dac5d1ca3e0c993c25f7879af89 (patch)
tree3bf91613eef1416e3d16edbc5439c3237c861aa3
parentfa5d9bb56498c90aa1046f1ea59f2419b896e53b (diff)
downloadweechat-01c6fb55668f7dac5d1ca3e0c993c25f7879af89.zip
logger: rename callback for infolist "logger_buffer"
-rw-r--r--src/plugins/logger/logger-info.c68
1 files changed, 32 insertions, 36 deletions
diff --git a/src/plugins/logger/logger-info.c b/src/plugins/logger/logger-info.c
index 1a403d899..9b5ef970c 100644
--- a/src/plugins/logger/logger-info.c
+++ b/src/plugins/logger/logger-info.c
@@ -28,57 +28,52 @@
/*
- * Returns infolist with logger info.
+ * Returns logger infolist "logger_buffer".
*/
struct t_infolist *
-logger_info_get_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+logger_info_infolist_logger_buffer_cb (void *data, const char *infolist_name,
+ void *pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_logger_buffer *ptr_logger_buffer;
/* make C compiler happy */
(void) data;
+ (void) infolist_name;
(void) arguments;
- if (!infolist_name || !infolist_name[0])
+ if (pointer && !logger_buffer_valid (pointer))
return NULL;
- if (weechat_strcasecmp (infolist_name, "logger_buffer") == 0)
+ ptr_infolist = weechat_infolist_new ();
+ if (!ptr_infolist)
+ return NULL;
+
+ if (pointer)
{
- if (pointer && !logger_buffer_valid (pointer))
+ /* build list with only one logger buffer */
+ if (!logger_buffer_add_to_infolist (ptr_infolist, pointer))
+ {
+ weechat_infolist_free (ptr_infolist);
return NULL;
-
- ptr_infolist = weechat_infolist_new ();
- if (ptr_infolist)
+ }
+ return ptr_infolist;
+ }
+ else
+ {
+ /* build list with all logger buffers */
+ for (ptr_logger_buffer = logger_buffers; ptr_logger_buffer;
+ ptr_logger_buffer = ptr_logger_buffer->next_buffer)
{
- if (pointer)
- {
- /* build list with only one logger buffer */
- if (!logger_buffer_add_to_infolist (ptr_infolist, pointer))
- {
- weechat_infolist_free (ptr_infolist);
- return NULL;
- }
- return ptr_infolist;
- }
- else
+ if (!logger_buffer_add_to_infolist (ptr_infolist,
+ ptr_logger_buffer))
{
- /* build list with all logger buffers */
- for (ptr_logger_buffer = logger_buffers; ptr_logger_buffer;
- ptr_logger_buffer = ptr_logger_buffer->next_buffer)
- {
- if (!logger_buffer_add_to_infolist (ptr_infolist,
- ptr_logger_buffer))
- {
- weechat_infolist_free (ptr_infolist);
- return NULL;
- }
- }
- return ptr_infolist;
+ weechat_infolist_free (ptr_infolist);
+ return NULL;
}
}
+ return ptr_infolist;
}
return NULL;
@@ -91,8 +86,9 @@ logger_info_get_infolist_cb (void *data, const char *infolist_name,
void
logger_info_init ()
{
- weechat_hook_infolist ("logger_buffer", N_("list of logger buffers"),
- N_("logger pointer (optional)"),
- NULL,
- &logger_info_get_infolist_cb, NULL);
+ weechat_hook_infolist (
+ "logger_buffer", N_("list of logger buffers"),
+ N_("logger pointer (optional)"),
+ NULL,
+ &logger_info_infolist_logger_buffer_cb, NULL);
}