gplugin/gplugin

Parents f14783ee151b
Children c6d9f51e0a88
Add a new macro for exporting the native plugin symbols and use it in the loaders

Testing Done:
Compiled and ran the unit tests

Bugs closed: GPLUGIN-132

Reviewed at https://reviews.imfreedom.org/r/578/
--- a/gplugin/gplugin-native-loader.c Wed Apr 28 04:30:29 2021 -0500
+++ b/gplugin/gplugin-native-loader.c Tue May 04 22:00:16 2021 -0500
@@ -21,9 +21,16 @@
#include <gplugin/gplugin-core.h>
#include <gplugin/gplugin-native-loader.h>
#include <gplugin/gplugin-native-plugin.h>
-#include <gplugin/gplugin-native-private.h>
#include <gplugin/gplugin-private.h>
+/**
+ * SECTION:gplugin-native-loader
+ * @title: Native Plugin Loader API
+ * @short_description: the native plugin loader API
+ *
+ * This section contains the native plugin loader API of GPlugin.
+ */
+
#define GPLUGIN_QUERY_SYMBOL "gplugin_query"
#define GPLUGIN_LOAD_SYMBOL "gplugin_load"
#define GPLUGIN_UNLOAD_SYMBOL "gplugin_unload"
@@ -283,7 +290,7 @@
/* get and call the function */
g_object_get(G_OBJECT(plugin), "load-func", &func, NULL);
- if(!func(GPLUGIN_NATIVE_PLUGIN(plugin), error)) {
+ if(!func(plugin, error)) {
if(error && *error == NULL)
g_set_error_literal(error, GPLUGIN_DOMAIN, 0, _("unknown failure"));
@@ -319,7 +326,7 @@
}
/* now call the function */
- if(!func(GPLUGIN_NATIVE_PLUGIN(plugin), error)) {
+ if(!func(plugin, error)) {
if(error && *error == NULL)
g_set_error_literal(error, GPLUGIN_DOMAIN, 0, _("unknown failure"));
--- a/gplugin/gplugin-native-plugin.c Wed Apr 28 04:30:29 2021 -0500
+++ b/gplugin/gplugin-native-plugin.c Tue May 04 22:00:16 2021 -0500
@@ -21,7 +21,14 @@
#include <gplugin/gplugin-loader.h>
#include <gplugin/gplugin-manager.h>
#include <gplugin/gplugin-native-plugin.h>
-#include <gplugin/gplugin-native-private.h>
+
+/**
+ * SECTION:gplugin-native-plugin
+ * @title: Native Plugin API
+ * @short_description: the native plugin API
+ *
+ * This section contains the native plugin API of GPlugin.
+ */
/**
* GPLUGIN_TYPE_NATIVE_PLUGIN:
@@ -36,6 +43,84 @@
* compiled to machine native code, typically these are written in C/C++.
*/
+/**
+ * GPluginNativePluginQueryFunc:
+ * @error: A return address for a #GError.
+ *
+ * Specifies the function signature for the query function of a plugin.
+ *
+ * Returns: (transfer full): A #GPluginPluginInfo instance on success or %NULL
+ * with @error set on error.
+ *
+ * Since: 0.31.0
+ */
+
+/**
+ * GPluginNativePluginLoadFunc:
+ * @plugin: The #GPluginPlugin instance.
+ * @error: A return address for a #GError.
+ *
+ * Specifies the function signature for the load function of a plugin.
+ *
+ * Returns: %TRUE if @plugin was successfully loaded, or %FALSE with @error
+ * set on failure.
+ *
+ * Since: 0.31.0
+ */
+
+/**
+ * GPluginNativePluginUnloadFunc:
+ * @plugin: The #GPluginPlugin instance.
+ * @error: A return address for a #GError.
+ *
+ * Specifies the function signature for the unload function of a plugin.
+ *
+ * Returns: %TRUE if @plugin was successfully unloaded, or %FALSE with @error
+ * set on failure.
+ *
+ * Since: 0.31.0
+ */
+
+/**
+ * GPLUGIN_NATIVE_PLUGIN_DECLARE:
+ * @name: The prefix of the user defined function names.
+ *
+ * This macro expands to the proper functions that #GPluginNativeLoader looks
+ * for when querying a plugin. They will call user defined functions named
+ * <function>${name}_query</function>, <function>${name}_load</function>,
+ * and <function>${name}_unload</function> which need to match the signatures
+ * of #GPluginNativePluginQueryFunc, #GPluginNativePluginLoadFunc, and
+ * #GPluginNativePluginUnloadFunc.
+ *
+ * This macro should be used over manually exporting the individual functions
+ * to help with updates as well as future features like static plugin loading.
+ *
+ * <informalexample><programlisting>
+ * GPLUGIN_NATIVE_PLUGIN_DECLARE(my_awesome_plugin)
+ * </programlisting></informalexample>
+ *
+ * will expand to
+ *
+ * <informalexample><programlisting>
+ * G_MODULE_EXPORT GPluginPluginInfo *gplugin_query(GError **error);
+ * G_MODULE_EXPORT GPluginPluginInfo *gplugin_query(GError **error) {
+ * return my_awesome_plugin_query(error);
+ * }
+ *
+ * G_MODULE_EXPORT gboolean gplugin_load(GPluginPlugin *plugin, GError **error);
+ * G_MODULE_EXPORT gboolean gplugin_load(GPluginPlugin *plugin, GError **error) {
+ * return my_awesome_plugin_load(error);
+ * }
+ *
+ * G_MODULE_EXPORT gboolean gplugin_unload(GPluginPlugin *plugin, GError **error);
+ * G_MODULE_EXPORT gboolean gplugin_unload(GPluginPlugin *plugin, GError **error) {
+ * return my_awesome_plugin_unload(plugin, error);
+ * }
+ * </programlisting></informalexample>
+ *
+ * Since: 0.31.0
+ */
+
/******************************************************************************
* Structs
*****************************************************************************/
--- a/gplugin/gplugin-native-plugin.h Wed Apr 28 04:30:29 2021 -0500
+++ b/gplugin/gplugin-native-plugin.h Tue May 04 22:00:16 2021 -0500
@@ -24,6 +24,7 @@
#include <gmodule.h>
+#include <gplugin/gplugin-plugin-info.h>
#include <gplugin/gplugin-plugin.h>
G_BEGIN_DECLS
@@ -36,8 +37,45 @@
NATIVE_PLUGIN,
GTypeModule)
+/* clang-format formats these in a way that breaks gtk-doc, so we have to
+ * leave them as is.
+ */
+
+/* clang-format off */
+typedef GPluginPluginInfo *(*GPluginNativePluginQueryFunc)(GError **error);
+typedef gboolean (*GPluginNativePluginLoadFunc)(GPluginPlugin *plugin, GError **error);
+typedef gboolean (*GPluginNativePluginUnloadFunc)(GPluginPlugin *plugin, GError **error);
+/* clang-format on */
+
GModule *gplugin_native_plugin_get_module(GPluginNativePlugin *plugin);
+#define GPLUGIN_NATIVE_PLUGIN_DECLARE(name) \
+ G_MODULE_EXPORT GPluginPluginInfo *gplugin_query(GError **error); \
+ G_MODULE_EXPORT GPluginPluginInfo *gplugin_query(GError **error) \
+ { \
+ return name##_query(error); \
+ } \
+\
+ G_MODULE_EXPORT gboolean gplugin_load( \
+ GPluginPlugin *plugin, \
+ GError **error); \
+ G_MODULE_EXPORT gboolean gplugin_load( \
+ GPluginPlugin *plugin, \
+ GError **error) \
+ { \
+ return name##_load(plugin, error); \
+ } \
+\
+ G_MODULE_EXPORT gboolean gplugin_unload( \
+ GPluginPlugin *plugin, \
+ GError **error); \
+ G_MODULE_EXPORT gboolean gplugin_unload( \
+ GPluginPlugin *plugin, \
+ GError **error) \
+ { \
+ return name##_unload(plugin, error); \
+ }
+
G_END_DECLS
#endif /* GPLUGIN_NATIVE_PLUGIN_H */
--- a/gplugin/gplugin-native-private.h Wed Apr 28 04:30:29 2021 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2011-2020 Gary Kramlich <grim@reaperworld.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, see <https://www.gnu.org/licenses/>.
- */
-
-#if !defined(GPLUGIN_GLOBAL_HEADER_INSIDE) && !defined(GPLUGIN_COMPILATION)
-#error "only <gplugin-native.h> may be included directly"
-#endif
-
-#ifndef GPLUGIN_NATIVE_PRIVATE_H
-#define GPLUGIN_NATIVE_PRIVATE_H
-
-#include <glib.h>
-
-#include <gplugin/gplugin-plugin-info.h>
-
-G_BEGIN_DECLS
-
-typedef GPluginPluginInfo *(*GPluginNativePluginQueryFunc)(GError **error);
-typedef gboolean (
- *GPluginNativePluginLoadFunc)(GPluginNativePlugin *plugin, GError **error);
-typedef gboolean (*GPluginNativePluginUnloadFunc)(
- GPluginNativePlugin *plugin,
- GError **error);
-
-G_END_DECLS
-
-#endif /* GPLUGIN_PRIVATE_H */
--- a/gplugin/meson.build Wed Apr 28 04:30:29 2021 -0500
+++ b/gplugin/meson.build Tue May 04 22:00:16 2021 -0500
@@ -87,7 +87,7 @@
# Helper Variables
###############################################################################
PRIVATE_HEADERS = GPLUGIN_PRIVATE_HEADERS + GPLUGIN_PRIVATE_BUILT_HEADERS + \
- ['gplugin-private.h', 'gplugin-native-private.h']
+ ['gplugin-private.h']
###############################################################################
# Configure Files
--- a/gplugin/reference/gplugin-docs.xml Wed Apr 28 04:30:29 2021 -0500
+++ b/gplugin/reference/gplugin-docs.xml Tue May 04 22:00:16 2021 -0500
@@ -41,7 +41,7 @@
</part>
<part id="API">
- <title>API Reference</title>
+ <title>API Reference</title>
<xi:include href="xml/gplugin-core.xml"/>
<xi:include href="xml/gplugin-loader.xml"/>
@@ -52,6 +52,13 @@
<xi:include href="xml/gplugin-version.xml"/>
</part>
+ <part id="Native API">
+ <title>Native API Reference</title>
+
+ <xi:include href="xml/gplugin-native-loader.xml"/>
+ <xi:include href="xml/gplugin-native-plugin.xml"/>
+ </part>
+
<index id="api-index-full">
<title>Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
@@ -60,5 +67,9 @@
<title>Index of deprecated symbols</title>
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
</index>
+ <index id="api-0.31.0">
+ <title>Index of new symbols in 0.31.0</title>
+ <xi:include href="xml/api-index-0.31.0.xml"><xi:fallback /></xi:include>
+ </index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</book>
--- a/gplugin/reference/meson.build Wed Apr 28 04:30:29 2021 -0500
+++ b/gplugin/reference/meson.build Tue May 04 22:00:16 2021 -0500
@@ -5,10 +5,7 @@
'dynamic-test.h',
'gplugin-enums.h',
'gplugin-loader-tests.h',
- 'gplugin-native-private.h',
'gplugin-native.h',
- 'gplugin-native-loader.h',
- 'gplugin-native-plugin.h',
'gplugin-private.h',
'gplugin.h',
]
--- a/gplugin/reference/native-plugins.xml Wed Apr 28 04:30:29 2021 -0500
+++ b/gplugin/reference/native-plugins.xml Tue May 04 22:00:16 2021 -0500
@@ -23,14 +23,16 @@
#include &lt;gplugin.h&gt;
#include &lt;gplugin-native.h&gt;
- /* gplugin_plugin_query is called by the native loader to determine if
- * the plugin is loadable. It must have this signature and should
- * return a valid GPluginPluginInfo instance if everything is fine. If
- * something went wrong, error should be set to a valid GError and NULL
- * should be returned.
+ /* This function is called by the native plugin loader to get information
+ * about the plugin. It returns a #GPluginPluginInfo instance that
+ * describes the plugin. If anything goes wrong during this function,
+ * @error should be set via g_set_error() and %NULL should be returned.
+ * It must match the signature of #GPluginNativePluginQueryFunc, and it
+ * will be passed to #GPLUGIN_NATIVE_PLUGIN_DECLARE which will export it
+ * properly.
*/
- G_MODULE_EXPORT GPluginPluginInfo *
- gplugin_plugin_query(GError **error) {
+ static GPluginPluginInfo *
+ gplugin_native_basic_plugin_query(GError **error) {
/* Authors is a list of authors who worked on the plugin. Generally
* these are in the "Name Surname &lt;user@domain.com&gt;" format.
*/
@@ -43,7 +45,7 @@
* rest are here for demonstration purposes.
*/
return gplugin_plugin_info_new(
- "gplugin/basic-native-plugin",
+ "gplugin/native-basic-plugin",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
"name", "name",
"version", "version",
@@ -54,25 +56,38 @@
NULL);
}
- /* gplugin_plugin_load is called by the loader when the plugin should
- * be loaded. It must have this exact signature and return TRUE if
- * loading was successful, otherwise it should return FALSE with error
- * set to a valid GError.
+ /* This function is called by the native plugin loader when the plugin
+ * should be loaded. It should do any setup that the plugin requires and
+ * return %TRUE if everything was successfull. If not, it should set
+ * @error with g_set_error() and return %FALSE. This function needs to
+ * match the signature of #GPluginNativePluginLoadFunc, and it will be
+ * passed to #GPLUGIN_NATIVE_PLUGIN_DECLARE which will export it
+ * properly.
*/
- G_MODULE_EXPORT gboolean
- gplugin_plugin_load(GPluginNativePlugin *plugin, GError **error) {
+ static gboolean
+ gplugin_native_basic_plugin_load(GPluginPlugin *plugin, GError **error) {
return TRUE;
}
- /* gplugin_plugin_unload is called by the loader when the plugin should
- * be unloaded. It must have this exact signature and should return TRUE
- * if unloading was successful, otherwise it should return FALSE with
- * error set to a valid GError.
+ /* This function is called by the native plugin loader when the plugin
+ * should be unloaded. It should do any clean up that the plugin requires
+ * and return %TRUE if everything was successfull. If not, it should set
+ * @error with g_set_error() and return %FALSE. This function needs to
+ * match the signature of #GPluginNativePluginUnloadFunc, and it will be
+ * passed to #GPLUGIN_NATIVE_PLUGIN_DECLARE which will export it
+ * properly.
*/
- G_MODULE_EXPORT gboolean
- gplugin_plugin_unload(GPluginNativePlugin *plugin, GError **error) {
+ static gboolean
+ gplugin_native_basic_plugin_unload(GPluginPlugin *plugin, GError *error) {
return TRUE;
}
+
+ /* This macro does the heavy lifting of making sure to export all of the
+ * symbols correctly as well as add some future proofing for features
+ * like statically plugins. It is highly recommended to use this macro
+ * instead of manually exporting the symbols yourself.
+ */
+ GPLUGIN_NATIVE_PLUGIN_DECLARE(gplugin_native_basic_plugin)
</programlisting></informalexample>
</para>
</simplesect>
--- a/lua/gplugin-lua-core.c Wed Apr 28 04:30:29 2021 -0500
+++ b/lua/gplugin-lua-core.c Tue May 04 22:00:16 2021 -0500
@@ -23,8 +23,8 @@
#include "gplugin-lua-loader.h"
#include "gplugin-lua-plugin.h"
-G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error)
+static GPluginPluginInfo *
+gplugin_lua_query(G_GNUC_UNUSED GError **error)
{
/* clang-format-11 formats this correctly, so this can be removed then. */
/* clang-format off */
@@ -53,17 +53,17 @@
/* clang-format on */
}
-G_MODULE_EXPORT gboolean
-gplugin_load(GPluginNativePlugin *plugin, GError **error)
+static gboolean
+gplugin_lua_load(GPluginPlugin *plugin, GError **error)
{
- gplugin_lua_loader_register(plugin);
- gplugin_lua_plugin_register(plugin);
+ gplugin_lua_loader_register(G_TYPE_MODULE(plugin));
+ gplugin_lua_plugin_register(G_TYPE_MODULE(plugin));
return gplugin_manager_register_loader(GPLUGIN_LUA_TYPE_LOADER, error);
}
-G_MODULE_EXPORT gboolean
-gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error)
+static gboolean
+gplugin_lua_unload(G_GNUC_UNUSED GPluginPlugin *plugin, GError **error)
{
g_set_error_literal(
error,
@@ -73,3 +73,6 @@
return FALSE;
}
+
+GPLUGIN_NATIVE_PLUGIN_DECLARE(gplugin_lua)
+
--- a/lua/gplugin-lua-loader.c Wed Apr 28 04:30:29 2021 -0500
+++ b/lua/gplugin-lua-loader.c Tue May 04 22:00:16 2021 -0500
@@ -211,7 +211,7 @@
* API
*****************************************************************************/
void
-gplugin_lua_loader_register(GPluginNativePlugin *plugin)
+gplugin_lua_loader_register(GTypeModule *module)
{
- gplugin_lua_loader_register_type(G_TYPE_MODULE(plugin));
+ gplugin_lua_loader_register_type(module);
}
--- a/lua/gplugin-lua-loader.h Wed Apr 28 04:30:29 2021 -0500
+++ b/lua/gplugin-lua-loader.h Tue May 04 22:00:16 2021 -0500
@@ -31,7 +31,7 @@
LOADER,
GPluginLoader)
-void gplugin_lua_loader_register(GPluginNativePlugin *plugin);
+void gplugin_lua_loader_register(GTypeModule *module);
G_END_DECLS
--- a/lua/gplugin-lua-plugin.c Wed Apr 28 04:30:29 2021 -0500
+++ b/lua/gplugin-lua-plugin.c Tue May 04 22:00:16 2021 -0500
@@ -200,9 +200,9 @@
* API
*****************************************************************************/
void
-gplugin_lua_plugin_register(GPluginNativePlugin *native)
+gplugin_lua_plugin_register(GTypeModule *module)
{
- gplugin_lua_plugin_register_type(G_TYPE_MODULE(native));
+ gplugin_lua_plugin_register_type(module);
}
lua_State *
--- a/lua/gplugin-lua-plugin.h Wed Apr 28 04:30:29 2021 -0500
+++ b/lua/gplugin-lua-plugin.h Tue May 04 22:00:16 2021 -0500
@@ -33,7 +33,7 @@
PLUGIN,
GObject)
-void gplugin_lua_plugin_register(GPluginNativePlugin *native);
+void gplugin_lua_plugin_register(GTypeModule *module);
lua_State *gplugin_lua_plugin_get_state(GPluginLuaPlugin *plugin);
--- a/perl5/gplugin-perl5-core.c Wed Apr 28 04:30:29 2021 -0500
+++ b/perl5/gplugin-perl5-core.c Tue May 04 22:00:16 2021 -0500
@@ -24,8 +24,8 @@
#undef _
#include <glib/gi18n-lib.h>
-G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(GError **error)
+static GPluginPluginInfo *
+gplugin_perl5_query(G_GNUC_UNUSED GError **error)
{
const gchar *const authors[] = {
"Gary Kramlich <grim@reaperworld.com>",
@@ -52,17 +52,17 @@
/* clang-format on */
}
-G_MODULE_EXPORT gboolean
-gplugin_load(GPluginNativePlugin *plugin, GError **error)
+static gboolean
+gplugin_perl5_load(GPluginPlugin *plugin, GError **error)
{
- gplugin_perl_plugin_register(plugin);
- gplugin_perl_loader_register(plugin);
+ gplugin_perl_plugin_register(G_TYPE_MODULE(plugin));
+ gplugin_perl_loader_register(G_TYPE_MODULE(plugin));
return gplugin_manager_register_loader(GPLUGIN_PERL_TYPE_LOADER, error);
}
-G_MODULE_EXPORT gboolean
-gplugin_unload(GPluginNativePlugin *plugin, GError **error)
+static gboolean
+gplugin_perl5_unload(G_GNUC_UNUSED GPluginPlugin *plugin, GError **error)
{
g_set_error_literal(
error,
@@ -72,3 +72,6 @@
return FALSE;
}
+
+GPLUGIN_NATIVE_PLUGIN_DECLARE(gplugin_perl5)
+
--- a/perl5/gplugin-perl5-loader.c Wed Apr 28 04:30:29 2021 -0500
+++ b/perl5/gplugin-perl5-loader.c Tue May 04 22:00:16 2021 -0500
@@ -326,7 +326,7 @@
* API
*****************************************************************************/
void
-gplugin_perl_loader_register(GPluginNativePlugin *plugin)
+gplugin_perl_loader_register(GTypeModule *module)
{
- gplugin_perl_loader_register_type(G_TYPE_MODULE(plugin));
+ gplugin_perl_loader_register_type(module);
}
--- a/perl5/gplugin-perl5-loader.h Wed Apr 28 04:30:29 2021 -0500
+++ b/perl5/gplugin-perl5-loader.h Tue May 04 22:00:16 2021 -0500
@@ -31,7 +31,7 @@
LOADER,
GPluginLoader)
-void gplugin_perl_loader_register(GPluginNativePlugin *plugin);
+void gplugin_perl_loader_register(GTypeModule *module);
G_END_DECLS
--- a/perl5/gplugin-perl5-plugin.c Wed Apr 28 04:30:29 2021 -0500
+++ b/perl5/gplugin-perl5-plugin.c Tue May 04 22:00:16 2021 -0500
@@ -203,9 +203,9 @@
* API
*****************************************************************************/
void
-gplugin_perl_plugin_register(GPluginNativePlugin *native)
+gplugin_perl_plugin_register(GTypeModule *module)
{
- gplugin_perl_plugin_register_type(G_TYPE_MODULE(native));
+ gplugin_perl_plugin_register_type(module);
}
PerlInterpreter *
--- a/perl5/gplugin-perl5-plugin.h Wed Apr 28 04:30:29 2021 -0500
+++ b/perl5/gplugin-perl5-plugin.h Tue May 04 22:00:16 2021 -0500
@@ -48,7 +48,7 @@
PLUGIN,
GObject)
-void gplugin_perl_plugin_register(GPluginNativePlugin *native);
+void gplugin_perl_plugin_register(GTypeModule *module);
PerlInterpreter *gplugin_perl_plugin_get_interpreter(GPluginPerlPlugin *plugin);
--- a/python3/gplugin-python3-core.c Wed Apr 28 04:30:29 2021 -0500
+++ b/python3/gplugin-python3-core.c Tue May 04 22:00:16 2021 -0500
@@ -23,8 +23,8 @@
#include "gplugin-python3-loader.h"
#include "gplugin-python3-plugin.h"
-G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error)
+static GPluginPluginInfo *
+gplugin_python3_query(G_GNUC_UNUSED GError **error)
{
/* clang-format-11 formats this correctly, so this can be removed then. */
/* clang-format off */
@@ -53,17 +53,17 @@
/* clang-format on */
}
-G_MODULE_EXPORT gboolean
-gplugin_load(GPluginNativePlugin *plugin, G_GNUC_UNUSED GError **error)
+static gboolean
+gplugin_python3_load(GPluginPlugin *plugin, GError **error)
{
- gplugin_python3_plugin_register(plugin);
- gplugin_python3_loader_register(plugin);
+ gplugin_python3_plugin_register(G_TYPE_MODULE(plugin));
+ gplugin_python3_loader_register(G_TYPE_MODULE(plugin));
return gplugin_manager_register_loader(GPLUGIN_PYTHON3_TYPE_LOADER, error);
}
-G_MODULE_EXPORT gboolean
-gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error)
+static gboolean
+gplugin_python3_unload(G_GNUC_UNUSED GPluginPlugin *plugin, GError **error)
{
g_set_error_literal(
error,
@@ -73,3 +73,6 @@
return FALSE;
}
+
+GPLUGIN_NATIVE_PLUGIN_DECLARE(gplugin_python3)
+
--- a/python3/gplugin-python3-loader.c Wed Apr 28 04:30:29 2021 -0500
+++ b/python3/gplugin-python3-loader.c Tue May 04 22:00:16 2021 -0500
@@ -393,9 +393,9 @@
* API
*****************************************************************************/
void
-gplugin_python3_loader_register(GPluginNativePlugin *native)
+gplugin_python3_loader_register(GTypeModule *module)
{
- gplugin_python3_loader_register_type(G_TYPE_MODULE(native));
+ gplugin_python3_loader_register_type(module);
gplugin_python3_loader_init_python();
}
--- a/python3/gplugin-python3-loader.h Wed Apr 28 04:30:29 2021 -0500
+++ b/python3/gplugin-python3-loader.h Tue May 04 22:00:16 2021 -0500
@@ -31,7 +31,7 @@
LOADER,
GPluginLoader)
-void gplugin_python3_loader_register(GPluginNativePlugin *native);
+void gplugin_python3_loader_register(GTypeModule *module);
G_END_DECLS
--- a/python3/gplugin-python3-plugin.c Wed Apr 28 04:30:29 2021 -0500
+++ b/python3/gplugin-python3-plugin.c Tue May 04 22:00:16 2021 -0500
@@ -304,7 +304,7 @@
* API
*****************************************************************************/
void
-gplugin_python3_plugin_register(GPluginNativePlugin *native)
+gplugin_python3_plugin_register(GTypeModule *module)
{
- gplugin_python3_plugin_register_type(G_TYPE_MODULE(native));
+ gplugin_python3_plugin_register_type(module);
}
--- a/python3/gplugin-python3-plugin.h Wed Apr 28 04:30:29 2021 -0500
+++ b/python3/gplugin-python3-plugin.h Tue May 04 22:00:16 2021 -0500
@@ -31,7 +31,7 @@
PLUGIN,
GObject)
-void gplugin_python3_plugin_register(GPluginNativePlugin *native);
+void gplugin_python3_plugin_register(GTypeModule *module);
G_END_DECLS