create a global header for finch
create a global include file for finch
protect all the finch header files and update the plugins to use the global header
Reviewed at https://reviews.imfreedom.org/r/61/
--- a/finch/finch.h Thu Aug 13 21:07:35 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
- * Finch is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * 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 2 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, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- * @section_id: finch-finch
- * @short_description: <filename>finch.h</filename>
- * @title: UI Definitions and Includes
-#define FINCH_UI "gnt-purple"
-#define FINCH_PREFS_ROOT "/finch"
- * @argc: Address of the argc parameter of your main() function (or 0 if argv
- * is %NULL). This will be changed if any arguments were handled.
- * @argv: Address of the argv parameter of main(), or %NULL. Any options
- * understood by Finch are stripped before return.
- * Start finch with the given command line arguments.
-gboolean finch_start(int *argc, char ***argv);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/finch/finch.h.in Thu Aug 13 21:10:22 2020 -0500
@@ -0,0 +1,33 @@
+ * Finch is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * 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 2 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 FINCH_GLOBAL_HEADER_INSIDE +#define FINCH_GLOBAL_HEADER_INSIDE +#undef FINCH_GLOBAL_HEADER_INSIDE --- a/finch/gntaccount.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntaccount.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntblist.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntblist.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntconn.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntconn.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntconv.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntconv.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntdebug.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntdebug.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntidle.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntidle.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntlog.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntlog.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntmedia.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntmedia.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntmenuutil.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntmenuutil.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntnotify.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntnotify.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntplugin.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntplugin.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntpounce.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntpounce.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntprefs.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntprefs.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntrequest.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntrequest.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntroomlist.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntroomlist.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntsound.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntsound.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntstatus.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntstatus.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntui.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntui.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- a/finch/gntxfer.h Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/gntxfer.h Thu Aug 13 21:10:22 2020 -0500
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/finch/libfinch.h Thu Aug 13 21:10:22 2020 -0500
@@ -0,0 +1,57 @@
+ * Finch is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * 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 2 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/>. +#if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION) +# error "only <finch.h> may be included directly" +#define FINCH_UI "gnt-purple" +#define FINCH_PREFS_ROOT "/finch" + * @section_id: finch-finch + * @short_description: <filename>libfinch.h</filename> + * @title: UI Definitions and Includes + * @argc: Address of the argc parameter of your main() function (or 0 if argv + * is %NULL). This will be changed if any arguments were handled. + * @argv: Address of the argv parameter of main(), or %NULL. Any options + * understood by Finch are stripped before return. + * Start finch with the given command line arguments. +gboolean finch_start(int *argc, char ***argv); --- a/finch/meson.build Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/meson.build Thu Aug 13 21:10:22 2020 -0500
@@ -128,7 +128,6 @@
@@ -142,7 +141,8 @@
@@ -167,12 +167,26 @@
+ foreach header : libfinch_headers + FINCH_H_INCLUDES += '#include <finch/@0@>'.format(header) + finch_h_conf = configuration_data() + finch_h_conf.set('FINCH_H_INCLUDES', '\n'.join(FINCH_H_INCLUDES)) + finch_h = configure_file(input : 'finch.h.in', + configuration : finch_h_conf, + install_dir : join_paths(get_option('includedir'), install_headers(libfinch_headers, subdir : 'finch-3')
libfinch_inc = include_directories('.')
libfinch = shared_library('finch3',
- c_args : ['-DSTANDALONE', '-DGNTSEAL_ENABLE', ncurses_header],
+ c_args : ['-DSTANDALONE', '-DGNTSEAL_ENABLE', '-DFINCH_COMPILATION', ncurses_header], include_directories : [toplevel_inc],
version : PURPLE_LIB_VERSION,
dependencies : [libpurple_dep, libgnt_dep, ncurses, glib, winmm],
@@ -214,7 +228,7 @@
gplugin_include_directories,
- extra_args : ['--quiet'])
+ extra_args : ['-DFINCH_COMPILATION', '--quiet']) --- a/finch/plugins/gntclipboard.c Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/plugins/gntclipboard.c Thu Aug 13 21:10:22 2020 -0500
@@ -39,7 +39,7 @@
--- a/finch/plugins/gntgf.c Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/plugins/gntgf.c Thu Aug 13 21:10:22 2020 -0500
@@ -50,8 +50,7 @@
--- a/finch/plugins/gnthistory.c Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/plugins/gnthistory.c Thu Aug 13 21:10:22 2020 -0500
@@ -22,9 +22,7 @@
#define HISTORY_PLUGIN_ID "gnt-history"
--- a/finch/plugins/gnttinyurl.c Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/plugins/gnttinyurl.c Thu Aug 13 21:10:22 2020 -0500
@@ -30,14 +30,13 @@
static SoupSession *session = NULL;
static GHashTable *tinyurl_cache = NULL;
--- a/finch/plugins/grouping.c Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/plugins/grouping.c Thu Aug 13 21:10:22 2020 -0500
@@ -20,10 +20,10 @@
#define FINCH_TYPE_GROUPING_NODE (finch_grouping_node_get_type())
#define FINCH_GROUPING_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), FINCH_TYPE_GROUPING_NODE, FinchGroupingNode))
--- a/finch/plugins/lastlog.c Thu Aug 13 21:07:35 2020 -0500
+++ b/finch/plugins/lastlog.c Thu Aug 13 21:10:22 2020 -0500
@@ -26,8 +26,7 @@