summaryrefslogtreecommitdiff
path: root/src/plugins/demo/demo.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2007-11-26 14:27:53 +0000
committerSebastien Helleu <flashcode@flashtux.org>2007-11-26 14:27:53 +0000
commitf5d026a775cc940c16d23ee9559140f4606d8aff (patch)
tree7809ee4bd647a8985692ad781e638c431806f144 /src/plugins/demo/demo.c
parent7cc78f4172631fc67d10045518dc6c5ac63ac66a (diff)
downloadweechat-f5d026a775cc940c16d23ee9559140f4606d8aff.zip
Added input_data callback argument to gui_buffer_new() function
Diffstat (limited to 'src/plugins/demo/demo.c')
-rw-r--r--src/plugins/demo/demo.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c
index d25e7d304..6797e5afc 100644
--- a/src/plugins/demo/demo.c
+++ b/src/plugins/demo/demo.c
@@ -49,23 +49,22 @@ demo_printf_command_cb (void *data, void *buffer, int argc, char **argv,
{
/* make C compiler happy */
(void) data;
- (void) buffer;
(void) argv;
if (argc > 1)
- weechat_printf (weechat_current_buffer,
- "demo_printf: %s", argv_eol[1]);
+ weechat_printf (buffer,
+ "demo_printf: '%s'", argv_eol[1]);
else
{
- weechat_printf (weechat_current_buffer,
+ weechat_printf (buffer,
"demo message without prefix");
- weechat_printf (weechat_current_buffer,
+ weechat_printf (buffer,
"%sdemo message with info prefix",
weechat_prefix ("info"));
- weechat_printf (weechat_current_buffer,
+ weechat_printf (buffer,
"%sdemo message with error prefix",
weechat_prefix ("error"));
- weechat_printf (weechat_current_buffer,
+ weechat_printf (buffer,
"colors: %s buffer %s nick1 %s nick2 %s nick3 "
"%s nick4",
weechat_color ("col_chat_buffer"),
@@ -79,6 +78,16 @@ demo_printf_command_cb (void *data, void *buffer, int argc, char **argv,
}
/*
+ * demo_buffer_input_data_cb: callback for input data on buffer
+ */
+
+static void
+demo_buffer_input_data_cb (struct t_gui_buffer *buffer, char *data)
+{
+ weechat_printf (buffer, "buffer input_data_cb: data = '%s'", data);
+}
+
+/*
* demo_buffer_command_cb: demo command for creatig new buffer
*/
@@ -95,7 +104,8 @@ demo_buffer_command_cb (void *data, void *buffer, int argc, char **argv,
if (argc > 2)
{
- new_buffer = weechat_buffer_new (argv[1], argv[2]);
+ new_buffer = weechat_buffer_new (argv[1], argv[2],
+ demo_buffer_input_data_cb);
if (new_buffer)
weechat_buffer_set (new_buffer, "display", "1");
}