[geany/geany] cc7f7f: Merge pull request #1406 from kugel-/for-upstream

elextr git-noreply at xxxxx
Fri Mar 3 11:00:27 UTC 2017


Branch:      refs/heads/master
Author:      elextr <elextr at gmail.com>
Committer:   GitHub <noreply at github.com>
Date:        Fri, 03 Mar 2017 11:00:27 UTC
Commit:      cc7f7f7164956c8ba872f6c9ffa5ed0f6712a9d7
             https://github.com/geany/geany/commit/cc7f7f7164956c8ba872f6c9ffa5ed0f6712a9d7

Log Message:
-----------
Merge pull request #1406 from kugel-/for-upstream

api: new function geany_api_version for dynamic languages checking API version at runtime


Modified Paths:
--------------
    src/plugindata.h
    src/pluginutils.c
    src/pluginutils.h

Modified: src/plugindata.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -59,7 +59,7 @@ G_BEGIN_DECLS
  * @warning You should not test for values below 200 as previously
  * @c GEANY_API_VERSION was defined as an enum value, not a macro.
  */
-#define GEANY_API_VERSION 230
+#define GEANY_API_VERSION 231
 
 /* hack to have a different ABI when built with GTK3 because loading GTK2-linked plugins
  * with GTK3-linked Geany leads to crash */


Modified: src/pluginutils.c
16 lines changed, 16 insertions(+), 0 deletions(-)
===================================================================
@@ -52,6 +52,22 @@ typedef struct
 PluginDocDataProxy;
 
 
+/** Returns the runtime API version Geany was compiled with.
+ *
+ * Unlike @ref GEANY_API_VERSION this version is the value of that
+ * define at the time when Geany itself was compiled. This allows to
+ * establish soft dependencies which are resolved at runtime depending
+ * on Geany's API version.
+ *
+ * @return Geany's API version
+ * @since 1.30 (API 231)
+ **/
+GEANY_API_SYMBOL
+gint geany_api_version(void)
+{
+	return GEANY_API_VERSION;
+}
+
 /** Inserts a toolbar item before the Quit button, or after the previous plugin toolbar item.
  * A separator is added on the first call to this function, and will be shown when @a item is
  * shown; hidden when @a item is hidden.


Modified: src/pluginutils.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -35,6 +35,7 @@ G_BEGIN_DECLS
 struct GeanyPlugin;
 struct GeanyDocument;
 
+gint geany_api_version(void);
 
 void plugin_add_toolbar_item(struct GeanyPlugin *plugin, GtkToolItem *item);
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list