Here's a patch that allows plugins to use *geany_debug*, for your
consideration.  I'm not real happy about the way things have to be named to
conform to the existing conventions (requiring a new struct named *
GeanyFuncs*, which might be easily confused with struct *GeanyFunctions* in
plugins.c and plugindata.h), so feel free to muck with this if there is a
better way.

- tony
Index: src/plugindata.h
===================================================================
--- src/plugindata.h	(revision 4706)
+++ src/plugindata.h	(working copy)
@@ -238,6 +238,7 @@
 	struct PluginFuncs        	*p_plugin;			/**< See pluginutils.c */
 	struct ScintillaFuncs		*p_scintilla;		/**< See ScintillaFuncs */
 	struct MsgWinFuncs			*p_msgwin;			/**< See msgwindow.h */
+	struct GeanyFuncs			*p_geany;			/**< See geany.h/log.c */
 }
 GeanyFunctions;
 
@@ -587,6 +588,13 @@
 }
 PluginFuncs;
 
+/* See log.c */
+/* prototype declaration for geany_debug is in geany.h */
+typedef struct GeanyFuncs
+{
+	void	(*geany_debug)(const gchar *format, ...) G_GNUC_PRINTF (1, 2);
+}
+GeanyFuncs;
 
 /* Deprecated aliases */
 #ifndef GEANY_DISABLE_DEPRECATED
Index: src/plugins.c
===================================================================
--- src/plugins.c	(revision 4706)
+++ src/plugins.c	(working copy)
@@ -299,6 +299,10 @@
 	&main_is_realized
 };
 
+static GeanyFuncs geany_funcs = {
+	&geany_debug
+};
+
 static GeanyFunctions geany_functions = {
 	&doc_funcs,
 	&sci_funcs,
@@ -319,7 +323,8 @@
 	&main_funcs,
 	&plugin_funcs,
 	&scintilla_funcs,
-	&msgwin_funcs
+	&msgwin_funcs,
+	&geany_funcs
 };
 
 static GeanyData geany_data;
_______________________________________________
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to