summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/CMakeLists.txt4
-rw-r--r--src/plugins/Makefile.am6
-rw-r--r--src/plugins/demo/CMakeLists.txt22
-rw-r--r--src/plugins/demo/Makefile.am25
-rw-r--r--src/plugins/demo/demo.c61
-rw-r--r--src/plugins/demo/demo.h27
6 files changed, 144 insertions, 1 deletions
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index 513706618..8ee79046b 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -54,3 +54,7 @@ ENDIF(NOT DISABLE_FIFO)
IF(NOT DISABLE_TRIGGER)
ADD_SUBDIRECTORY( trigger )
ENDIF(NOT DISABLE_TRIGGER)
+
+IF(ENABLE_DEMO)
+ ADD_SUBDIRECTORY( demo )
+ENDIF(ENABLE_TRIGGER)
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 338552c80..cae0dbf2d 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -64,4 +64,8 @@ if PLUGIN_TRIGGER
trigger_dir = trigger
endif
-SUBDIRS = . $(irc_dir) $(script_dir) $(aspell_dir) $(charset_dir) $(fifo_dir) $(trigger_dir)
+if PLUGIN_DEMO
+demo_dir = demo
+endif
+
+SUBDIRS = . $(irc_dir) $(script_dir) $(aspell_dir) $(charset_dir) $(fifo_dir) $(trigger_dir) $(demo_dir)
diff --git a/src/plugins/demo/CMakeLists.txt b/src/plugins/demo/CMakeLists.txt
new file mode 100644
index 000000000..a8ed8da0a
--- /dev/null
+++ b/src/plugins/demo/CMakeLists.txt
@@ -0,0 +1,22 @@
+# Copyright (c) 2003-2007 FlashCode <flashcode@flashtux.org>
+#
+# 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/>.
+#
+
+ADD_LIBRARY(demo MODULE demo.c demo.h)
+SET_TARGET_PROPERTIES(demo PROPERTIES PREFIX "")
+
+TARGET_LINK_LIBRARIES(demo)
+
+INSTALL(TARGETS demo LIBRARY DESTINATION lib/${PROJECT_NAME}/plugins)
diff --git a/src/plugins/demo/Makefile.am b/src/plugins/demo/Makefile.am
new file mode 100644
index 000000000..1947a77f8
--- /dev/null
+++ b/src/plugins/demo/Makefile.am
@@ -0,0 +1,25 @@
+# Copyright (c) 2003-2007 FlashCode <flashcode@flashtux.org>
+#
+# 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/>.
+#
+
+INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(DEMO_CFLAGS)
+
+libdir = ${weechat_libdir}/plugins
+
+lib_LTLIBRARIES = demo.la
+
+demo_la_SOURCES = demo.c demo.h
+demo_la_LDFLAGS = -module
+demo_la_LIBADD = $(DEMO_LFLAGS)
diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c
new file mode 100644
index 000000000..3d81d4e66
--- /dev/null
+++ b/src/plugins/demo/demo.c
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2003-2007 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/>.
+ */
+
+/* demo.c: demo plugin for WeeChat */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "../weechat-plugin.h"
+#include "demo.h"
+
+
+static struct t_weechat_plugin *weechat_plugin = NULL;
+
+
+/*
+ * weechat_plugin_init: init demo plugin
+ */
+
+int
+weechat_plugin_init (struct t_weechat_plugin *plugin)
+{
+ weechat_plugin = plugin;
+
+ return PLUGIN_RC_SUCCESS;
+}
+
+/*
+ * weechat_plugin_end: end demo plugin
+ */
+
+int
+weechat_plugin_end ()
+{
+ return PLUGIN_RC_SUCCESS;
+}
diff --git a/src/plugins/demo/demo.h b/src/plugins/demo/demo.h
new file mode 100644
index 000000000..c55ece428
--- /dev/null
+++ b/src/plugins/demo/demo.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2003-2007 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/>.
+ */
+
+
+#ifndef __WEECHAT_DEMO_H
+#define __WEECHAT_DEMO_H 1
+
+char plugin_name[] = "demo";
+char plugin_version[] = "0.1";
+char plugin_description[] = "Demo plugin for WeeChat";
+
+#endif /* demo.h */