summaryrefslogtreecommitdiff
path: root/src/plugins/fifo/fifo-info.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fifo/fifo-info.c')
-rw-r--r--src/plugins/fifo/fifo-info.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/plugins/fifo/fifo-info.c b/src/plugins/fifo/fifo-info.c
new file mode 100644
index 000000000..e9f46f5a6
--- /dev/null
+++ b/src/plugins/fifo/fifo-info.c
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org>
+ * See README for License detail, AUTHORS for developers list.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* fifo-info.c: info and infolist hooks for fifo plugin */
+
+
+#include <stdlib.h>
+
+#include "../weechat-plugin.h"
+#include "fifo.h"
+
+
+/*
+ * fifo_info_get_info_cb: callback called when fifo info is asked
+ */
+
+char *
+fifo_info_get_info_cb (void *data, const char *info_name,
+ const char *arguments)
+{
+ /* make C compiler happy */
+ (void) data;
+ (void) arguments;
+
+ if (weechat_strcasecmp (info_name, "fifo_filename") == 0)
+ {
+ return fifo_filename;
+ }
+
+ return NULL;
+}
+
+/*
+ * fifo_info_init: initialize info and infolist hooks for fifo plugin
+ */
+
+void
+fifo_info_init ()
+{
+ /* fifo info hooks */
+ weechat_hook_info ("fifo_filename", &fifo_info_get_info_cb, NULL);
+}