1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 23:06:38 +02:00

Added demo plugin

This commit is contained in:
Sebastien Helleu
2007-11-03 12:42:30 +01:00
parent f6ed0f2e5b
commit 2e18be982f
8 changed files with 167 additions and 4 deletions
+4
View File
@@ -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)
+5 -1
View File
@@ -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)
+22
View File
@@ -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)
+25
View File
@@ -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)
+61
View File
@@ -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;
}
+27
View File
@@ -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 */