From ca854a289f1b1af565f5d7701d7a0d8b78cb1680 Mon Sep 17 00:00:00 2001 From: eta Date: Fri, 13 Aug 2021 17:31:14 +0100 Subject: [PATCH] xmpp: initialize stub plugin --- CMakeLists.txt | 1 + src/plugins/CMakeLists.txt | 4 +++ src/plugins/xmpp/CMakeLists.txt | 26 ++++++++++++++++++ src/plugins/xmpp/xmpp.c | 48 +++++++++++++++++++++++++++++++++ src/plugins/xmpp/xmpp.h | 28 +++++++++++++++++++ 5 files changed, 107 insertions(+) create mode 100644 src/plugins/xmpp/CMakeLists.txt create mode 100644 src/plugins/xmpp/xmpp.c create mode 100644 src/plugins/xmpp/xmpp.h diff --git a/CMakeLists.txt b/CMakeLists.txt index e62f1e4c6..ec3ebc1bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,6 +117,7 @@ option(ENABLE_ENCHANT "Enable Enchant lib for Spell checker plugin" OFF) option(ENABLE_TRIGGER "Enable Trigger plugin" ON) option(ENABLE_TYPING "Enable Tryping plugin" ON) option(ENABLE_XFER "Enable Xfer plugin" ON) +option(ENABLE_XMPP "Enable XMPP plugin" ON) option(ENABLE_MAN "Enable build of man page" OFF) option(ENABLE_DOC "Enable build of documentation" OFF) option(ENABLE_TESTS "Enable tests" OFF) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 44b6544b0..b939c564f 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -192,4 +192,8 @@ if(ENABLE_XFER) add_subdirectory(xfer) endif() +if(ENABLE_XMPP) + add_subdirectory(xmpp) +endif() + install(FILES weechat-plugin.h DESTINATION ${INCLUDEDIR}) diff --git a/src/plugins/xmpp/CMakeLists.txt b/src/plugins/xmpp/CMakeLists.txt new file mode 100644 index 000000000..d1b4514ff --- /dev/null +++ b/src/plugins/xmpp/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright (C) 2021 eta +# +# This file is part of WeeChat, the extensible chat client. +# +# WeeChat 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. +# +# WeeChat 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 WeeChat. If not, see . +# + +add_library(xmpp MODULE + xmpp.c xmpp.h +) +set_target_properties(xmpp PROPERTIES PREFIX "") + +target_link_libraries(xmpp coverage_config) + +install(TARGETS xmpp LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins) diff --git a/src/plugins/xmpp/xmpp.c b/src/plugins/xmpp/xmpp.c new file mode 100644 index 000000000..8dd7c8c15 --- /dev/null +++ b/src/plugins/xmpp/xmpp.c @@ -0,0 +1,48 @@ +/* + * xmpp.c - incredibly cursed XMPP plugin + * + * Copyright (C) 2021 eta + * + * This file is part of WeeChat, the extensible chat client. + * + * WeeChat 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. + * + * WeeChat 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 WeeChat. If not, see . + */ + +#include +#include +#include +#include + +#include "../weechat-plugin.h" +#include "xmpp.h" + +struct t_weechat_plugin *weechat_xmpp_plugin = NULL; + +WEECHAT_PLUGIN_NAME(XMPP_PLUGIN_NAME); +WEECHAT_PLUGIN_DESCRIPTION(N_("Cursed XMPP plugin")); +WEECHAT_PLUGIN_AUTHOR("eta "); +WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION); +WEECHAT_PLUGIN_LICENSE(WEECHAT_LICENSE); +WEECHAT_PLUGIN_PRIORITY(8000); + +int weechat_plugin_init(struct t_weechat_plugin *plugin, int argc, char **argv) { + weechat_plugin = plugin; + weechat_printf(NULL, "xmpp: init"); + return WEECHAT_RC_OK; +} + +int weechat_plugin_end(struct t_weechat_plugin *plugin) { + weechat_printf(NULL, "xmpp: end"); + return WEECHAT_RC_OK; +} diff --git a/src/plugins/xmpp/xmpp.h b/src/plugins/xmpp/xmpp.h new file mode 100644 index 000000000..dd66d6f33 --- /dev/null +++ b/src/plugins/xmpp/xmpp.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2021 eta + * + * This file is part of WeeChat, the extensible chat client. + * + * WeeChat 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. + * + * WeeChat 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 WeeChat. If not, see . + */ + +#ifndef WEECHAT_PLUGIN_XMPP_H +#define WEECHAT_PLUGIN_XMPP_H + +#define weechat_plugin weechat_xmpp_plugin +#define XMPP_PLUGIN_NAME "xmpp" + +extern struct t_weechat_plugin *weechat_xmpp_plugin; + +#endif