This is the initial clang-format run
--- a/gplugin-gtk-viewer/gplugin-gtk-viewer-window.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin-gtk-viewer/gplugin-gtk-viewer-window.c Wed Feb 26 03:13:57 2020 -0600
@@ -22,30 +22,33 @@
-G_DEFINE_TYPE(GPluginGtkViewerWindow, gplugin_gtk_viewer_window, GTK_TYPE_WINDOW)
+ GPluginGtkViewerWindow, + gplugin_gtk_viewer_window, /******************************************************************************
*****************************************************************************/
-gplugin_gtk_viewer_window_init(GPluginGtkViewerWindow *window) {
+gplugin_gtk_viewer_window_init(GPluginGtkViewerWindow *window) gtk_widget_init_template(GTK_WIDGET(window));
-gplugin_gtk_viewer_window_class_init(GPluginGtkViewerWindowClass *klass) {
+gplugin_gtk_viewer_window_class_init(GPluginGtkViewerWindowClass *klass) gtk_widget_class_set_template_from_resource(
- "/org/bitbucket/gplugin/gplugin/viewer/window.ui"
+ "/org/bitbucket/gplugin/gplugin/viewer/window.ui"); /******************************************************************************
*****************************************************************************/
-GtkWidget *gplugin_gtk_viewer_window_new(void) {
- return GTK_WIDGET(g_object_new(
- GPLUGIN_GTK_VIEWER_TYPE_WINDOW,
+gplugin_gtk_viewer_window_new(void) + return GTK_WIDGET(g_object_new(GPLUGIN_GTK_VIEWER_TYPE_WINDOW, NULL)); --- a/gplugin-gtk-viewer/gplugin-gtk-viewer-window.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin-gtk-viewer/gplugin-gtk-viewer-window.h Wed Feb 26 03:13:57 2020 -0600
@@ -18,13 +18,18 @@
#ifndef GPLUGIN_GTK_VIEWER_WINDOW_H
#define GPLUGIN_GTK_VIEWER_WINDOW_H
+#include <glib-object.h> -#include <glib-object.h>
#define GPLUGIN_GTK_VIEWER_TYPE_WINDOW (gplugin_gtk_viewer_window_get_type())
-G_DECLARE_FINAL_TYPE(GPluginGtkViewerWindow, gplugin_gtk_viewer_window, GPLUGIN_GTK_VIEWER, WINDOW, GtkWindow)
+ GPluginGtkViewerWindow, + gplugin_gtk_viewer_window, --- a/gplugin-gtk-viewer/gplugin-gtk-viewer.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin-gtk-viewer/gplugin-gtk-viewer.c Wed Feb 26 03:13:57 2020 -0600
@@ -20,8 +20,8 @@
+#include <gplugin-gtk/gplugin-gtk.h> #include <gplugin/gplugin.h>
-#include <gplugin-gtk/gplugin-gtk.h>
/******************************************************************************
@@ -34,9 +34,10 @@
*****************************************************************************/
-window_closed_cb(G_GNUC_UNUSED GtkWidget *w,
- G_GNUC_UNUSED GdkEvent *e,
- G_GNUC_UNUSED gpointer d)
+ G_GNUC_UNUSED GtkWidget *w, + G_GNUC_UNUSED GdkEvent *e, + G_GNUC_UNUSED gpointer d) @@ -44,16 +45,20 @@
-selection_changed_cb(GtkTreeSelection *sel, gpointer data) {
+selection_changed_cb(GtkTreeSelection *sel, gpointer data) GPluginGtkPluginInfo *info = GPLUGIN_GTK_PLUGIN_INFO(data);
GPluginPlugin *plugin = NULL;
GtkTreeModel *model = NULL;
if(gtk_tree_selection_get_selected(sel, &model, &iter)) {
- gtk_tree_model_get(model, &iter,
- GPLUGIN_GTK_STORE_PLUGIN_COLUMN, &plugin,
+ GPLUGIN_GTK_STORE_PLUGIN_COLUMN, gplugin_gtk_plugin_info_set_plugin(info, plugin);
@@ -63,10 +68,11 @@
*****************************************************************************/
-internal_cb(G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
- G_GNUC_UNUSED gpointer d,
- G_GNUC_UNUSED GError **e)
+ G_GNUC_UNUSED const gchar *n, + G_GNUC_UNUSED const gchar *v, + G_GNUC_UNUSED gpointer d, + G_GNUC_UNUSED GError **e) @@ -74,10 +80,11 @@
-no_default_cb(G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
- G_GNUC_UNUSED gpointer d,
- G_GNUC_UNUSED GError **e)
+ G_GNUC_UNUSED const gchar *n, + G_GNUC_UNUSED const gchar *v, + G_GNUC_UNUSED gpointer d, + G_GNUC_UNUSED GError **e) add_default_paths = FALSE;
@@ -85,10 +92,11 @@
-version_cb(G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
- G_GNUC_UNUSED gpointer d,
- G_GNUC_UNUSED GError **e)
+ G_GNUC_UNUSED const gchar *n, + G_GNUC_UNUSED const gchar *v, + G_GNUC_UNUSED gpointer d, + G_GNUC_UNUSED GError **e) @@ -98,7 +106,8 @@
GtkWidget *window = NULL, *grid = NULL, *sw = NULL;
GtkWidget *view = NULL, *info = NULL;
GtkTreeSelection *sel = NULL;
@@ -106,8 +115,11 @@
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "GPlugin Viewer");
gtk_container_set_border_width(GTK_CONTAINER(window), 12);
- g_signal_connect(G_OBJECT(window), "delete-event",
- G_CALLBACK(window_closed_cb), NULL);
+ G_CALLBACK(window_closed_cb), gtk_grid_set_row_homogeneous(GTK_GRID(grid), TRUE);
@@ -115,10 +127,11 @@
gtk_container_add(GTK_CONTAINER(window), grid);
sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
+ gtk_scrolled_window_set_policy( + GTK_SCROLLED_WINDOW(sw), + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); gtk_grid_attach(GTK_GRID(grid), sw, 0, 0, 1, 1);
view = gplugin_gtk_view_new();
@@ -129,8 +142,11 @@
gtk_grid_attach(GTK_GRID(grid), info, 1, 0, 1, 1);
sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
- g_signal_connect(G_OBJECT(sel), "changed",
- G_CALLBACK(selection_changed_cb), info);
+ G_CALLBACK(selection_changed_cb), @@ -163,7 +179,8 @@
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) GOptionContext *ctx = NULL;
GtkWidget *window = NULL;
--- a/gplugin-gtk/gplugin-gtk-plugin-info.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin-gtk/gplugin-gtk-plugin-info.c Wed Feb 26 03:13:57 2020 -0600
@@ -71,7 +71,9 @@
-static GParamSpec *properties[N_PROPERTIES] = {NULL,};
+static GParamSpec *properties[N_PROPERTIES] = { G_DEFINE_TYPE(GPluginGtkPluginInfo, gplugin_gtk_plugin_info, GTK_TYPE_BOX);
@@ -79,8 +81,9 @@
*****************************************************************************/
-gplugin_gtk_plugin_info_expander_activate(GtkExpander *expander,
- G_GNUC_UNUSED gpointer data)
+gplugin_gtk_plugin_info_expander_activate( + G_GNUC_UNUSED gpointer data) if(gtk_expander_get_expanded(expander))
gtk_expander_set_label(expander, "More");
@@ -92,8 +95,9 @@
*****************************************************************************/
-_gplugin_gtk_plugin_info_refresh(GPluginGtkPluginInfo *info,
+_gplugin_gtk_plugin_info_refresh( + GPluginGtkPluginInfo *info, GtkWidget *widget = NULL;
GList *children = NULL, *iter = NULL;
@@ -142,16 +146,19 @@
/* fanagle the plugin name */
- markup = g_markup_printf_escaped("<span font_size=\"large\" "
- "font_weight=\"bold\">%s</span>",
- (name) ? name : "Unnamed");
+ markup = g_markup_printf_escaped( + "<span font_size=\"large\" " + "font_weight=\"bold\">%s</span>", + (name) ? name : "Unnamed"); /* fanagle the website */
- markup = g_markup_printf_escaped("<a href=\"%s\">%s</a>",
+ markup = g_markup_printf_escaped( + "<a href=\"%s\">%s</a>", @@ -166,10 +173,14 @@
gtk_label_set_text(GTK_LABEL(info->version), (version) ? version : "");
gtk_label_set_markup(GTK_LABEL(info->website), (website) ? website : "");
gtk_label_set_text(GTK_LABEL(info->summary), (summary) ? summary : "");
- gtk_label_set_text(GTK_LABEL(info->description), (description) ? description : "");
+ GTK_LABEL(info->description), + (description) ? description : ""); gtk_label_set_text(GTK_LABEL(info->id), (id) ? id : "");
gtk_label_set_text(GTK_LABEL(info->filename), (filename) ? filename : "");
- gtk_label_set_text(GTK_LABEL(info->abi_version), (abi_version) ? abi_version : "");
+ GTK_LABEL(info->abi_version), + (abi_version) ? abi_version : ""); gtk_label_set_text(GTK_LABEL(info->loader), (loader) ? loader : "Unknown");
gtk_label_set_text(GTK_LABEL(info->internal), (internal) ? "Yes" : "No");
gtk_label_set_text(GTK_LABEL(info->load_on_query), (loq) ? "Yes" : "No");
@@ -189,7 +200,12 @@
widget = gtk_label_new(authors[i]);
gtk_widget_set_halign(widget, GTK_ALIGN_START);
gtk_widget_set_valign(widget, GTK_ALIGN_START);
- gtk_box_pack_start(GTK_BOX(info->authors_box), widget, TRUE, TRUE, 0);
+ GTK_BOX(info->authors_box), @@ -200,8 +216,11 @@
*****************************************************************************/
-gplugin_gtk_plugin_info_set_property(GObject *obj, guint prop_id,
- const GValue *value, GParamSpec *pspec)
+gplugin_gtk_plugin_info_set_property( GPluginGtkPluginInfo *info = GPLUGIN_GTK_PLUGIN_INFO(obj);
@@ -216,15 +235,17 @@
-gplugin_gtk_plugin_info_get_property(GObject *obj, guint prop_id,
- GValue *value, GParamSpec *pspec)
+gplugin_gtk_plugin_info_get_property( GPluginGtkPluginInfo *info = GPLUGIN_GTK_PLUGIN_INFO(obj);
- g_value_set_object(value,
- gplugin_gtk_plugin_info_get_plugin(info));
+ g_value_set_object(value, gplugin_gtk_plugin_info_get_plugin(info)); G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, prop_id, pspec);
@@ -233,7 +254,8 @@
-gplugin_gtk_plugin_info_finalize(GObject *obj) {
+gplugin_gtk_plugin_info_finalize(GObject *obj) GPluginGtkPluginInfo *info = GPLUGIN_GTK_PLUGIN_INFO(obj);
g_clear_object(&info->plugin);
@@ -242,12 +264,14 @@
-gplugin_gtk_plugin_info_init(GPluginGtkPluginInfo *info) {
+gplugin_gtk_plugin_info_init(GPluginGtkPluginInfo *info) gtk_widget_init_template(GTK_WIDGET(info));
-gplugin_gtk_plugin_info_class_init(GPluginGtkPluginInfoClass *klass) {
+gplugin_gtk_plugin_info_class_init(GPluginGtkPluginInfoClass *klass) GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
@@ -257,34 +281,77 @@
properties[PROP_PLUGIN] = g_param_spec_object(
"The GPluginPlugin who's info should be displayed",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT); gtk_widget_class_set_template_from_resource(
- "/org/bitbucket/gplugin/gplugin-gtk/plugin-info.ui"
+ "/org/bitbucket/gplugin/gplugin-gtk/plugin-info.ui"); - gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, name);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, version);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, authors_box);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, website);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, summary);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, description);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, dependencies);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, expander);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, id);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, filename);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, abi_version);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, loader);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, internal);
- gtk_widget_class_bind_template_child(widget_class, GPluginGtkPluginInfo, load_on_query);
+ gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( + gtk_widget_class_bind_template_child( - gtk_widget_class_bind_template_callback(widget_class, gplugin_gtk_plugin_info_expander_activate);
+ gtk_widget_class_bind_template_callback( + gplugin_gtk_plugin_info_expander_activate); /******************************************************************************
@@ -300,7 +367,8 @@
* Returns: (transfer full): The new #GPluginGtkView widget.
-gplugin_gtk_plugin_info_new(void) {
+gplugin_gtk_plugin_info_new(void) return GTK_WIDGET(g_object_new(GPLUGIN_GTK_TYPE_PLUGIN_INFO, NULL));
@@ -314,8 +382,9 @@
* A @plugin value of %NULL will clear the widget.
-gplugin_gtk_plugin_info_set_plugin(GPluginGtkPluginInfo *info,
+gplugin_gtk_plugin_info_set_plugin( + GPluginGtkPluginInfo *info, g_return_if_fail(GPLUGIN_GTK_IS_PLUGIN_INFO(info));
@@ -334,8 +403,10 @@
-gplugin_gtk_plugin_info_get_plugin(GPluginGtkPluginInfo *info) {
+gplugin_gtk_plugin_info_get_plugin(GPluginGtkPluginInfo *info) g_return_val_if_fail(GPLUGIN_GTK_IS_PLUGIN_INFO(info), NULL);
- return (info->plugin) ? GPLUGIN_PLUGIN(g_object_ref(G_OBJECT(info->plugin))) : NULL;
+ return (info->plugin) ? GPLUGIN_PLUGIN(g_object_ref(G_OBJECT(info->plugin))) --- a/gplugin-gtk/gplugin-gtk-plugin-info.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin-gtk/gplugin-gtk-plugin-info.h Wed Feb 26 03:13:57 2020 -0600
@@ -15,15 +15,16 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
-#if !defined(GPLUGIN_GTK_GLOBAL_HEADER_INSIDE) && !defined(GPLUGIN_GTK_COMPILATION)
+#if !defined(GPLUGIN_GTK_GLOBAL_HEADER_INSIDE) && \ + !defined(GPLUGIN_GTK_COMPILATION) #error "only <gplugin/gplugin-gtk.h> may be included directly"
#ifndef GPLUGIN_GTK_PLUGIN_INFO_H
#define GPLUGIN_GTK_PLUGIN_INFO_H
+#include <glib-object.h> -#include <glib-object.h>
@@ -32,11 +33,18 @@
#define GPLUGIN_GTK_TYPE_PLUGIN_INFO (gplugin_gtk_plugin_info_get_type())
-G_DECLARE_FINAL_TYPE(GPluginGtkPluginInfo, gplugin_gtk_plugin_info, GPLUGIN_GTK, PLUGIN_INFO, GtkBox)
+ gplugin_gtk_plugin_info, GtkWidget *gplugin_gtk_plugin_info_new(void);
-void gplugin_gtk_plugin_info_set_plugin(GPluginGtkPluginInfo *info, GPluginPlugin *plugin);
+void gplugin_gtk_plugin_info_set_plugin( + GPluginGtkPluginInfo *info, + GPluginPlugin *plugin); GPluginPlugin *gplugin_gtk_plugin_info_get_plugin(GPluginGtkPluginInfo *info);
--- a/gplugin-gtk/gplugin-gtk-store.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin-gtk/gplugin-gtk-store.c Wed Feb 26 03:13:57 2020 -0600
@@ -69,7 +69,8 @@
*****************************************************************************/
-gplugin_gtk_store_add_plugin(GPluginGtkStore *store, GPluginPlugin *plugin) {
+gplugin_gtk_store_add_plugin(GPluginGtkStore *store, GPluginPlugin *plugin) GPluginPluginInfo *info = gplugin_plugin_get_info(plugin);
GPluginPluginState state = gplugin_plugin_get_state(plugin);
@@ -84,27 +85,37 @@
- g_string_append_printf(str, "<b>%s</b>\n",
- (name) ? name : "<i>Unnamed</i>");
- g_string_append_printf(str, "%s",
- (summary) ? summary : "<i>No Summary</i>");
+ g_string_append_printf( + (name) ? name : "<i>Unnamed</i>"); + g_string_append_printf( + (summary) ? summary : "<i>No Summary</i>"); gtk_list_store_append(GTK_LIST_STORE(store), &iter);
- gtk_list_store_set(GTK_LIST_STORE(store), &iter,
- GPLUGIN_GTK_STORE_LOADED_COLUMN, state == GPLUGIN_PLUGIN_STATE_LOADED,
- GPLUGIN_GTK_STORE_PLUGIN_COLUMN, g_object_ref(plugin),
- GPLUGIN_GTK_STORE_MARKUP_COLUMN, str->str,
+ GPLUGIN_GTK_STORE_LOADED_COLUMN, + state == GPLUGIN_PLUGIN_STATE_LOADED, + GPLUGIN_GTK_STORE_PLUGIN_COLUMN, + GPLUGIN_GTK_STORE_MARKUP_COLUMN, g_string_free(str, TRUE);
g_object_unref(G_OBJECT(info));
-gplugin_gtk_store_add_plugin_by_id(GPluginGtkStore *store, const gchar * id) {
+gplugin_gtk_store_add_plugin_by_id(GPluginGtkStore *store, const gchar *id) GSList *plugins = NULL, *l = NULL;
plugins = gplugin_manager_find_plugins(id);
@@ -114,27 +125,33 @@
-gplugin_gtk_store_update_plugin_state_cb(GtkTreeModel *model, GtkTreePath *path,
- GtkTreeIter *iter, gpointer data)
+gplugin_gtk_store_update_plugin_state_cb( GPluginPlugin *plugin_a = GPLUGIN_PLUGIN(data);
GPluginPlugin *plugin_b = NULL;
- GPLUGIN_GTK_STORE_PLUGIN_COLUMN, &plugin_b,
+ GPLUGIN_GTK_STORE_PLUGIN_COLUMN, if(plugin_a == plugin_b) {
- gboolean loaded = gplugin_plugin_get_state(plugin_a) == GPLUGIN_PLUGIN_STATE_LOADED;
+ gplugin_plugin_get_state(plugin_a) == GPLUGIN_PLUGIN_STATE_LOADED; - GTK_LIST_STORE(model), iter,
- GPLUGIN_GTK_STORE_LOADED_COLUMN, loaded,
+ GPLUGIN_GTK_STORE_LOADED_COLUMN, /* tell gplugin_gtk_store_update_plugin_state that we're done */
@@ -146,29 +163,33 @@
-gplugin_gtk_store_update_plugin_state(GPluginGtkStore *store,
+gplugin_gtk_store_update_plugin_state( + GPluginGtkStore *store, gplugin_gtk_store_update_plugin_state_cb,
/******************************************************************************
*****************************************************************************/
-gplugin_gtk_store_plugin_loaded_cb(GObject *manager, GPluginPlugin *plugin,
+gplugin_gtk_store_plugin_loaded_cb( gplugin_gtk_store_update_plugin_state(GPLUGIN_GTK_STORE(data), plugin);
-gplugin_gtk_store_plugin_unloaded_cb(GObject *manager, GPluginPlugin *plugin,
+gplugin_gtk_store_plugin_unloaded_cb( gplugin_gtk_store_update_plugin_state(GPLUGIN_GTK_STORE(data), plugin);
@@ -177,7 +198,8 @@
*****************************************************************************/
-gplugin_gtk_store_constructed(GObject *obj) {
+gplugin_gtk_store_constructed(GObject *obj) @@ -185,33 +207,44 @@
ids = gplugin_manager_list_plugins();
for(l = ids; l; l = l->next)
- gplugin_gtk_store_add_plugin_by_id(GPLUGIN_GTK_STORE(obj),
- (const gchar *)l->data);
+ gplugin_gtk_store_add_plugin_by_id( + GPLUGIN_GTK_STORE(obj), + (const gchar *)l->data); manager = gplugin_manager_get_instance();
- g_signal_connect(manager, "loaded-plugin",
- G_CALLBACK(gplugin_gtk_store_plugin_loaded_cb), obj);
- g_signal_connect(manager, "unloaded-plugin",
- G_CALLBACK(gplugin_gtk_store_plugin_unloaded_cb), obj);
+ G_CALLBACK(gplugin_gtk_store_plugin_loaded_cb), + G_CALLBACK(gplugin_gtk_store_plugin_unloaded_cb), -gplugin_gtk_store_dispose(GObject *obj) {
+gplugin_gtk_store_dispose(GObject *obj) G_OBJECT_CLASS(gplugin_gtk_store_parent_class)->dispose(obj);
-gplugin_gtk_store_init(GPluginGtkStore *store) {
+gplugin_gtk_store_init(GPluginGtkStore *store) GType *types = (GType *)gplugin_gtk_store_get_column_types();
- gtk_list_store_set_column_types(GTK_LIST_STORE(store),
- GPLUGIN_GTK_STORE_N_COLUMNS,
+ gtk_list_store_set_column_types( + GPLUGIN_GTK_STORE_N_COLUMNS, -gplugin_gtk_store_class_init(GPluginGtkStoreClass *klass) {
+gplugin_gtk_store_class_init(GPluginGtkStoreClass *klass) GObjectClass *obj_class = G_OBJECT_CLASS(klass);
obj_class->constructed = gplugin_gtk_store_constructed;
@@ -231,7 +264,8 @@
-gplugin_gtk_store_new(void) {
+gplugin_gtk_store_new(void) return GPLUGIN_GTK_STORE(g_object_new(GPLUGIN_GTK_TYPE_STORE, NULL));
@@ -244,6 +278,7 @@
-gplugin_gtk_store_get_column_types(void) {
+gplugin_gtk_store_get_column_types(void) --- a/gplugin-gtk/gplugin-gtk-store.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin-gtk/gplugin-gtk-store.h Wed Feb 26 03:13:57 2020 -0600
@@ -15,22 +15,28 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
-#if !defined(GPLUGIN_GTK_GLOBAL_HEADER_INSIDE) && !defined(GPLUGIN_GTK_COMPILATION)
+#if !defined(GPLUGIN_GTK_GLOBAL_HEADER_INSIDE) && \ + !defined(GPLUGIN_GTK_COMPILATION) #error "only <gplugin/gplugin-gtk.h> may be included directly"
#ifndef GPLUGIN_GTK_STORE_H
#define GPLUGIN_GTK_STORE_H
+#include <glib-object.h> -#include <glib-object.h>
#define GPLUGIN_GTK_TYPE_STORE (gplugin_gtk_store_get_type())
-G_DECLARE_FINAL_TYPE(GPluginGtkStore, gplugin_gtk_store, GPLUGIN_GTK, STORE, GtkListStore)
GPLUGIN_GTK_STORE_LOADED_COLUMN,
--- a/gplugin-gtk/gplugin-gtk-view.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin-gtk/gplugin-gtk-view.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,8 +15,8 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-gtk/gplugin-gtk-store.h> #include <gplugin-gtk/gplugin-gtk-view.h>
-#include <gplugin-gtk/gplugin-gtk-store.h>
#include <gplugin/gplugin.h>
@@ -58,15 +58,18 @@
-static GParamSpec *properties[N_PROPERTIES] = {NULL,};
+static GParamSpec *properties[N_PROPERTIES] = { /******************************************************************************
*****************************************************************************/
-gplugin_gtk_view_plugin_toggled_cb(GtkCellRendererToggle *rend,
+gplugin_gtk_view_plugin_toggled_cb( + GtkCellRendererToggle *rend, GPluginGtkView *view = GPLUGIN_GTK_VIEW(data);
GPluginPlugin *plugin = NULL;
@@ -84,9 +87,9 @@
- GPLUGIN_GTK_STORE_PLUGIN_COLUMN, &plugin,
+ GPLUGIN_GTK_STORE_PLUGIN_COLUMN, if(!GPLUGIN_IS_PLUGIN(plugin)) {
@@ -124,15 +127,19 @@
G_DEFINE_TYPE(GPluginGtkView, gplugin_gtk_view, GTK_TYPE_TREE_VIEW);
-gplugin_gtk_view_set_property(GObject *obj, guint prop_id, const GValue *value,
+gplugin_gtk_view_set_property( GPluginGtkView *view = GPLUGIN_GTK_VIEW(obj);
- gplugin_gtk_view_set_show_internal(view,
- g_value_get_boolean(value));
+ gplugin_gtk_view_set_show_internal( + g_value_get_boolean(value)); G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, prop_id, pspec);
@@ -141,15 +148,19 @@
-gplugin_gtk_view_get_property(GObject *obj, guint prop_id, GValue *value,
+gplugin_gtk_view_get_property( GPluginGtkView *view = GPLUGIN_GTK_VIEW(obj);
- g_value_set_boolean(value,
- gplugin_gtk_view_get_show_internal(view));
+ gplugin_gtk_view_get_show_internal(view)); G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, prop_id, pspec);
@@ -158,17 +169,20 @@
-gplugin_gtk_view_constructed(GObject *obj) {
+gplugin_gtk_view_constructed(GObject *obj) G_OBJECT_CLASS(gplugin_gtk_view_parent_class)->constructed(obj);
-gplugin_gtk_view_dispose(GObject *obj) {
+gplugin_gtk_view_dispose(GObject *obj) G_OBJECT_CLASS(gplugin_gtk_view_parent_class)->dispose(obj);
-gplugin_gtk_view_init(GPluginGtkView *view) {
+gplugin_gtk_view_init(GPluginGtkView *view) GtkTreeViewColumn *col = NULL;
GtkCellRenderer *rend = NULL;
@@ -179,12 +193,18 @@
rend = gtk_cell_renderer_toggle_new();
gtk_tree_view_column_pack_start(col, rend, FALSE);
- g_signal_connect(G_OBJECT(rend), "toggled",
- G_CALLBACK(gplugin_gtk_view_plugin_toggled_cb), view);
+ G_CALLBACK(gplugin_gtk_view_plugin_toggled_cb), gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
- gtk_tree_view_column_add_attribute(col, rend, "active",
- GPLUGIN_GTK_STORE_LOADED_COLUMN);
+ gtk_tree_view_column_add_attribute( + GPLUGIN_GTK_STORE_LOADED_COLUMN); /* create the markup column */
col = gtk_tree_view_column_new();
@@ -195,12 +215,16 @@
gtk_tree_view_column_pack_start(col, rend, TRUE);
gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
- gtk_tree_view_column_add_attribute(col, rend, "markup",
- GPLUGIN_GTK_STORE_MARKUP_COLUMN);
+ gtk_tree_view_column_add_attribute( + GPLUGIN_GTK_STORE_MARKUP_COLUMN); -gplugin_gtk_view_class_init(GPluginGtkViewClass *klass) {
+gplugin_gtk_view_class_init(GPluginGtkViewClass *klass) GObjectClass *obj_class = G_OBJECT_CLASS(klass);
obj_class->get_property = gplugin_gtk_view_get_property;
@@ -216,11 +240,11 @@
* Whether or not to show internal plugins.
properties[PROP_SHOW_INTERNAL] = g_param_spec_boolean(
- "show-internal", "show-internal",
"Whether or not to show internal plugins",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
@@ -237,7 +261,8 @@
* Returns: (transfer full): The new view.
-gplugin_gtk_view_new(void) {
+gplugin_gtk_view_new(void) GPluginGtkStore *store = gplugin_gtk_store_new();
@@ -260,8 +285,7 @@
-gplugin_gtk_view_set_show_internal(GPluginGtkView *view,
- gboolean show_internal)
+gplugin_gtk_view_set_show_internal(GPluginGtkView *view, gboolean show_internal) g_return_if_fail(GPLUGIN_GTK_IS_VIEW(view));
@@ -277,7 +301,8 @@
* Returns whether or not @view is showing internal plugins.
-gplugin_gtk_view_get_show_internal(GPluginGtkView *view) {
+gplugin_gtk_view_get_show_internal(GPluginGtkView *view) g_return_val_if_fail(GPLUGIN_GTK_IS_VIEW(view), FALSE);
return view->show_internal;
--- a/gplugin-gtk/gplugin-gtk-view.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin-gtk/gplugin-gtk-view.h Wed Feb 26 03:13:57 2020 -0600
@@ -15,26 +15,34 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
-#if !defined(GPLUGIN_GTK_GLOBAL_HEADER_INSIDE) && !defined(GPLUGIN_GTK_COMPILATION)
+#if !defined(GPLUGIN_GTK_GLOBAL_HEADER_INSIDE) && \ + !defined(GPLUGIN_GTK_COMPILATION) #error "only <gplugin/gplugin-gtk.h> may be included directly"
#ifndef GPLUGIN_GTK_VIEW_H
#define GPLUGIN_GTK_VIEW_H
+#include <glib-object.h> -#include <glib-object.h>
#define GPLUGIN_GTK_TYPE_VIEW (gplugin_gtk_view_get_type())
-G_DECLARE_FINAL_TYPE(GPluginGtkView, gplugin_gtk_view, GPLUGIN_GTK, VIEW, GtkTreeView)
GtkWidget *gplugin_gtk_view_new(void);
-void gplugin_gtk_view_set_show_internal(GPluginGtkView *view, gboolean show_internal);
+void gplugin_gtk_view_set_show_internal( + gboolean show_internal); gboolean gplugin_gtk_view_get_show_internal(GPluginGtkView *view);
--- a/gplugin/gplugin-core.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-core.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,13 +15,13 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <glib-object.h> #include <glib/gi18n-lib.h>
-#include <glib-object.h>
#include <gplugin/gplugin-core.h>
+#include <gplugin/gplugin-plugin.h> #include <gplugin/gplugin-private.h>
-#include <gplugin/gplugin-plugin.h>
@@ -59,7 +59,8 @@
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
@@ -72,6 +73,7 @@
* Uninitializes the GPlugin library
gplugin_manager_private_uninit();
--- a/gplugin/gplugin-core.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-core.h Wed Feb 26 03:13:57 2020 -0600
@@ -22,8 +22,8 @@
+#include <glib-object.h> -#include <glib-object.h>
#define GPLUGIN_DOMAIN (g_quark_from_static_string("gplugin"))
--- a/gplugin/gplugin-file-tree.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-file-tree.c Wed Feb 26 03:13:57 2020 -0600
@@ -23,7 +23,8 @@
*****************************************************************************/
-gplugin_file_tree_entry_new(const gchar *filename) {
+gplugin_file_tree_entry_new(const gchar *filename) GPluginFileTreeEntry *entry = NULL;
g_return_val_if_fail(filename, NULL);
@@ -35,8 +36,8 @@
/* we have to use e->filename, because g_utf8_strrchr returns a pointer
* in the string given too it, and not a new copy.
- entry->extension = g_utf8_strrchr(entry->filename, -1,
+ g_utf8_strrchr(entry->filename, -1, g_utf8_get_char(".")); /* if we have an extension, we need to iterate past the . */
@@ -46,7 +47,8 @@
-gplugin_file_tree_entry_free(GPluginFileTreeEntry *entry) {
+gplugin_file_tree_entry_free(GPluginFileTreeEntry *entry) @@ -60,10 +62,11 @@
*****************************************************************************/
-gplugin_file_tree_free_helper(GNode *n, G_GNUC_UNUSED gpointer d) {
+gplugin_file_tree_free_helper(GNode *n, G_GNUC_UNUSED gpointer d) GPluginFileTreeEntry *e = n->data;
gplugin_file_tree_entry_free(e);
@@ -81,7 +84,8 @@
* GPluginFileTreeEntry instance for the files in that directory.
-gplugin_file_tree_new(GList *paths) {
+gplugin_file_tree_new(GList *paths) @@ -97,9 +101,10 @@
dir = g_dir_open(path, 0, &error);
- g_debug(_("Failed to open %s: %s"),
- (error->message) ? error->message : _("unknown failure"));
+ _("Failed to open %s: %s"), + (error->message) ? error->message : _("unknown failure")); @@ -136,12 +141,17 @@
* Free's a previously created file tree.
-gplugin_file_tree_free(GNode *root) {
+gplugin_file_tree_free(GNode *root) - g_node_traverse(root, G_POST_ORDER,
- G_TRAVERSE_LEAVES | G_TRAVERSE_NON_LEAVES,
- -1, gplugin_file_tree_free_helper, NULL);
+ G_TRAVERSE_LEAVES | G_TRAVERSE_NON_LEAVES, + gplugin_file_tree_free_helper, --- a/gplugin/gplugin-loader-tests.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-loader-tests.c Wed Feb 26 03:13:57 2020 -0600
@@ -34,13 +34,14 @@
*****************************************************************************/
-gplugin_test_loader_full(gconstpointer d) {
+gplugin_test_loader_full(gconstpointer d) GPluginPlugin *plugin = NULL;
GPluginPluginInfo *info = NULL;
- const gchar * const r_authors[] = { "author1", NULL };
+ const gchar *const r_authors[] = {"author1", NULL}; id = g_strdup_printf("gplugin/%s-basic-plugin", (const gchar *)d);
@@ -53,8 +54,7 @@
g_assert_cmpstr(gplugin_plugin_info_get_id(info), ==, id);
- g_assert_cmpuint(gplugin_plugin_info_get_abi_version(info), ==,
+ g_assert_cmpuint(gplugin_plugin_info_get_abi_version(info), ==, 0x01020304); g_assert_cmpstr(gplugin_plugin_info_get_name(info), ==, "basic plugin");
authors = (gchar **)gplugin_plugin_info_get_authors(info);
@@ -65,30 +65,39 @@
g_assert_cmpstr(gplugin_plugin_info_get_version(info), ==, "version");
g_assert_cmpstr(gplugin_plugin_info_get_license_id(info), ==, "license");
g_assert_cmpstr(gplugin_plugin_info_get_summary(info), ==, "summary");
- g_assert_cmpstr(gplugin_plugin_info_get_description(info), ==,
+ gplugin_plugin_info_get_description(info), g_assert_cmpstr(gplugin_plugin_info_get_website(info), ==, "website");
g_object_unref(G_OBJECT(info));
- g_assert_cmpint(gplugin_plugin_get_state(plugin), ==,
- GPLUGIN_PLUGIN_STATE_QUERIED);
+ gplugin_plugin_get_state(plugin), + GPLUGIN_PLUGIN_STATE_QUERIED); gplugin_manager_load_plugin(plugin, &error);
g_assert_no_error(error);
- g_assert_cmpint(gplugin_plugin_get_state(plugin), ==,
- GPLUGIN_PLUGIN_STATE_LOADED);
+ gplugin_plugin_get_state(plugin), + GPLUGIN_PLUGIN_STATE_LOADED); gplugin_manager_unload_plugin(plugin, &error);
g_assert_no_error(error);
- g_assert_cmpint(gplugin_plugin_get_state(plugin), ==,
- GPLUGIN_PLUGIN_STATE_QUERIED);
+ gplugin_plugin_get_state(plugin), + GPLUGIN_PLUGIN_STATE_QUERIED); g_object_unref(G_OBJECT(plugin));
-gplugin_test_loader_load_failed(gconstpointer d) {
+gplugin_test_loader_load_failed(gconstpointer d) GPluginPlugin *plugin = NULL;
@@ -102,14 +111,17 @@
ret = gplugin_manager_load_plugin(plugin, &error);
g_assert_error(error, GPLUGIN_DOMAIN, 0);
- g_assert_cmpint(gplugin_plugin_get_state(plugin), ==,
- GPLUGIN_PLUGIN_STATE_LOAD_FAILED);
+ gplugin_plugin_get_state(plugin), + GPLUGIN_PLUGIN_STATE_LOAD_FAILED); g_object_unref(G_OBJECT(plugin));
-gplugin_test_loader_load_exception(gconstpointer d) {
+gplugin_test_loader_load_exception(gconstpointer d) GPluginPlugin *plugin = NULL;
@@ -123,14 +135,17 @@
ret = gplugin_manager_load_plugin(plugin, &error);
g_assert_error(error, GPLUGIN_DOMAIN, 0);
- g_assert_cmpint(gplugin_plugin_get_state(plugin), ==,
- GPLUGIN_PLUGIN_STATE_LOAD_FAILED);
+ gplugin_plugin_get_state(plugin), + GPLUGIN_PLUGIN_STATE_LOAD_FAILED); g_object_unref(G_OBJECT(plugin));
-gplugin_test_loader_unload_failed(gconstpointer d) {
+gplugin_test_loader_unload_failed(gconstpointer d) GPluginPlugin *plugin = NULL;
@@ -144,25 +159,30 @@
ret = gplugin_manager_load_plugin(plugin, &error);
g_assert_no_error(error);
- g_assert_cmpint(gplugin_plugin_get_state(plugin), ==,
- GPLUGIN_PLUGIN_STATE_LOADED);
+ gplugin_plugin_get_state(plugin), + GPLUGIN_PLUGIN_STATE_LOADED); ret = gplugin_manager_unload_plugin(plugin, &error);
g_assert_error(error, GPLUGIN_DOMAIN, 0);
- g_assert_cmpint(gplugin_plugin_get_state(plugin), ==,
- GPLUGIN_PLUGIN_STATE_LOADED);
+ gplugin_plugin_get_state(plugin), + GPLUGIN_PLUGIN_STATE_LOADED); g_object_unref(G_OBJECT(plugin));
-gplugin_test_loader_dependencies(gconstpointer d) {
+gplugin_test_loader_dependencies(gconstpointer d) GPluginPlugin *plugin = NULL;
GPluginPluginInfo *info = NULL;
- const gchar * const r_deps[] = { "dependency1", "dependency2", NULL };
+ const gchar *const r_deps[] = {"dependency1", "dependency2", NULL}; id = g_strdup_printf("gplugin/%s-dependent-plugin", (const gchar *)d);
@@ -184,16 +204,17 @@
*****************************************************************************/
static GPluginTestLoaderFunction test_functions[] = {
- { "/loaders/%s/full", gplugin_test_loader_full },
- { "/loaders/%s/load-failed", gplugin_test_loader_load_failed },
- { "/loaders/%s/load-exception", gplugin_test_loader_load_exception },
- { "/loaders/%s/unload-failed", gplugin_test_loader_unload_failed },
- { "/loaders/%s/dependencies", gplugin_test_loader_dependencies },
+ {"/loaders/%s/full", gplugin_test_loader_full}, + {"/loaders/%s/load-failed", gplugin_test_loader_load_failed}, + {"/loaders/%s/load-exception", gplugin_test_loader_load_exception}, + {"/loaders/%s/unload-failed", gplugin_test_loader_unload_failed}, + {"/loaders/%s/dependencies", gplugin_test_loader_dependencies}, -gplugin_loader_tests_add_tests(const gchar *short_name) {
+gplugin_loader_tests_add_tests(const gchar *short_name) for(i = 0; test_functions[i].path; i++) {
@@ -206,8 +227,10 @@
-gplugin_loader_tests_main(const gchar *loader_dir, const gchar *plugin_dir,
- const gchar *short_name)
+gplugin_loader_tests_main( + const gchar *loader_dir, + const gchar *plugin_dir, + const gchar *short_name) --- a/gplugin/gplugin-loader-tests.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-loader-tests.h Wed Feb 26 03:13:57 2020 -0600
@@ -18,13 +18,16 @@
#ifndef GPLUGIN_LOADER_TESTS_H
#define GPLUGIN_LOADER_TESTS_H
+#include <glib-object.h> -#include <glib-object.h>
void gplugin_loader_tests_add_tests(const gchar *short_name);
-void gplugin_loader_tests_main(const gchar *loader_dir, const gchar *plugin_dir, const gchar *short_name);
+void gplugin_loader_tests_main( + const gchar *loader_dir, + const gchar *plugin_dir, + const gchar *short_name); --- a/gplugin/gplugin-loader.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-loader.c Wed Feb 26 03:13:57 2020 -0600
@@ -60,11 +60,13 @@
G_DEFINE_ABSTRACT_TYPE(GPluginLoader, gplugin_loader, G_TYPE_OBJECT);
-gplugin_loader_init(G_GNUC_UNUSED GPluginLoader *loader) {
+gplugin_loader_init(G_GNUC_UNUSED GPluginLoader *loader) -gplugin_loader_class_init(G_GNUC_UNUSED GPluginLoaderClass *klass) {
+gplugin_loader_class_init(G_GNUC_UNUSED GPluginLoaderClass *klass) /******************************************************************************
@@ -84,8 +86,10 @@
-gplugin_loader_query_plugin(GPluginLoader *loader,
- const gchar *filename, GError **error)
+gplugin_loader_query_plugin( GPluginLoaderClass *klass = NULL;
@@ -114,8 +118,10 @@
* Return value: %TRUE if @plugin was loaded successfully, %FALSE otherwise.
-gplugin_loader_load_plugin(GPluginLoader *loader,
- GPluginPlugin *plugin, GError **error)
+gplugin_loader_load_plugin( GPluginLoaderClass *klass = NULL;
@@ -129,9 +135,12 @@
ret = klass->load(loader, plugin, error);
- if (!ret && error && *error == NULL) {
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- "Failed to load plugin : unknown");
+ if(!ret && error && *error == NULL) { + "Failed to load plugin : unknown"); @@ -149,8 +158,10 @@
* Return value: %TRUE if @plugin was unloaded successfully, %FALSE otherwise.
-gplugin_loader_unload_plugin(GPluginLoader *loader,
- GPluginPlugin *plugin, GError **error)
+gplugin_loader_unload_plugin( GPluginLoaderClass *klass = NULL;
@@ -164,9 +175,12 @@
if(klass && klass->unload)
ret = klass->unload(loader, plugin, error);
- if (!ret && error && *error == NULL) {
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- "Failed to unload plugin : unknown");
+ if(!ret && error && *error == NULL) { + "Failed to unload plugin : unknown"); @@ -184,7 +198,8 @@
* extensions that the loader supports.
-gplugin_loader_get_supported_extensions(GPluginLoader *loader) {
+gplugin_loader_get_supported_extensions(GPluginLoader *loader) GPluginLoaderClass *klass = NULL;
g_return_val_if_fail(GPLUGIN_IS_LOADER(loader), NULL);
--- a/gplugin/gplugin-loader.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-loader.h Wed Feb 26 03:13:57 2020 -0600
@@ -22,13 +22,18 @@
+#include <glib-object.h> -#include <glib-object.h>
#define GPLUGIN_TYPE_LOADER (gplugin_loader_get_type())
-G_DECLARE_DERIVABLE_TYPE(GPluginLoader, gplugin_loader, GPLUGIN, LOADER, GObject)
+G_DECLARE_DERIVABLE_TYPE( /* circular include so this needs to be after the G_DECLARE_* marcro */
#include <gplugin/gplugin-plugin.h>
@@ -40,10 +45,13 @@
GSList *(*supported_extensions)(GPluginLoader *loader);
- GPluginPlugin *(*query)(GPluginLoader *loader, const gchar *filename, GError **error);
+ *query)(GPluginLoader *loader, const gchar *filename, GError **error); - gboolean (*load)(GPluginLoader *loader, GPluginPlugin *plugin, GError **error);
- gboolean (*unload)(GPluginLoader *loader, GPluginPlugin *plugin, GError **error);
+ *load)(GPluginLoader *loader, GPluginPlugin *plugin, GError **error); + *unload)(GPluginLoader *loader, GPluginPlugin *plugin, GError **error); @@ -51,12 +59,20 @@
GSList *gplugin_loader_get_supported_extensions(GPluginLoader *loader);
-GPluginPlugin *gplugin_loader_query_plugin(GPluginLoader *loader, const gchar *filename, GError **error);
+GPluginPlugin *gplugin_loader_query_plugin( -gboolean gplugin_loader_load_plugin(GPluginLoader *loader, GPluginPlugin *plugin, GError **error);
-gboolean gplugin_loader_unload_plugin(GPluginLoader *loader, GPluginPlugin *plugin, GError **error);
+gboolean gplugin_loader_load_plugin( +gboolean gplugin_loader_unload_plugin( #endif /* GPLUGIN_LOADER_H */
--- a/gplugin/gplugin-manager.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-manager.c Wed Feb 26 03:13:57 2020 -0600
@@ -21,8 +21,8 @@
#include <glib/gi18n-lib.h>
+#include <gplugin/gplugin-core.h> #include <gplugin/gplugin-manager.h>
-#include <gplugin/gplugin-core.h>
#include <gplugin/gplugin-private.h>
@@ -77,8 +77,12 @@
GList *(*get_paths)(GPluginManager *manager);
- gboolean (*register_loader)(GPluginManager *manager, GType type, GError **error);
- gboolean (*unregister_loader)(GPluginManager *manager, GType type, GError **error);
+ *register_loader)(GPluginManager *manager, GType type, GError **error); + gboolean (*unregister_loader)( + GPluginManager *manager, void (*refresh)(GPluginManager *manager);
@@ -86,38 +90,55 @@
GList *(*list_plugins)(GPluginManager *manager);
- GSList *(*get_plugin_dependencies)(GPluginManager *manager, GPluginPlugin *plugin, GError **error);
+ GSList *(*get_plugin_dependencies)( + GPluginManager *manager, - gboolean (*load_plugin)(GPluginManager *manager,
- gboolean (*unload_plugin)(GPluginManager *manager,
+ gboolean (*load_plugin)( + GPluginManager *manager, + gboolean (*unload_plugin)( + GPluginManager *manager, - gboolean (*loading_plugin)(GObject *manager,
- void (*loaded_plugin)(GObject *manager,
- GPluginPlugin *plugin);
+ gboolean (*loading_plugin)( + void (*loaded_plugin)(GObject *manager, GPluginPlugin *plugin); void (*load_failed)(GObject *manager, GPluginPlugin *plugin);
- gboolean (*unloading_plugin)(GObject *manager,
- void (*unloaded_plugin)(GObject *manager,
- GPluginPlugin *plugin);
+ gboolean (*unloading_plugin)( + void (*unloaded_plugin)(GObject *manager, GPluginPlugin *plugin); -#define GPLUGIN_TYPE_MANAGER (gplugin_manager_get_type())
-#define GPLUGIN_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_MANAGER, GPluginManager))
-#define GPLUGIN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GPLUGIN_TYPE_MANAGER, GPluginManagerClass))
-#define GPLUGIN_IS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_MANAGER))
-#define GPLUGIN_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GPLUGIN_TYPE_MANAGER))
-#define GPLUGIN_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLUGIN_TYPE_MANAGER, GPluginManagerClass))
+#define GPLUGIN_TYPE_MANAGER (gplugin_manager_get_type()) +#define GPLUGIN_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_MANAGER, GPluginManager)) +#define GPLUGIN_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST( \ + GPLUGIN_TYPE_MANAGER, \ +#define GPLUGIN_IS_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_MANAGER)) +#define GPLUGIN_IS_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GPLUGIN_TYPE_MANAGER)) +#define GPLUGIN_MANAGER_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS( \ + GPLUGIN_TYPE_MANAGER, \ -#define GPLUGIN_MANAGER_INSTANCE (GPLUGIN_MANAGER(gplugin_manager_get_instance()))
+#define GPLUGIN_MANAGER_INSTANCE \ + (GPLUGIN_MANAGER(gplugin_manager_get_instance())) G_DEFINE_TYPE(GPluginManager, gplugin_manager, G_TYPE_OBJECT);
@@ -125,15 +146,19 @@
*****************************************************************************/
GPluginManager *instance = NULL;
-static guint signals[N_SIGNALS] = {0, };
-const gchar *dependency_pattern = "^(?P<id>.+?)((?P<op>\\<=|\\<|==|=|\\>=|\\>)(?P<version>.+))?$";
+static guint signals[N_SIGNALS] = { +const gchar *dependency_pattern = + "^(?P<id>.+?)((?P<op>\\<=|\\<|==|=|\\>=|\\>)(?P<version>.+))?$"; GRegex *dependency_regex = NULL;
/******************************************************************************
*****************************************************************************/
-gplugin_manager_str_hash(gconstpointer v) {
+gplugin_manager_str_hash(gconstpointer v) @@ -141,9 +166,10 @@
-gplugin_manager_remove_list_value(G_GNUC_UNUSED gpointer k,
- G_GNUC_UNUSED gpointer d)
+gplugin_manager_remove_list_value( + G_GNUC_UNUSED gpointer k, + G_GNUC_UNUSED gpointer d) @@ -167,7 +193,8 @@
* Returns: (transfer none): The #GPluginLoader instance or %NULL.
-gplugin_manager_find_loader_by_type(GPluginManager *manager, GType type) {
+gplugin_manager_find_loader_by_type(GPluginManager *manager, GType type) g_return_val_if_fail(GPLUGIN_IS_MANAGER(manager), NULL);
@@ -186,8 +213,7 @@
*****************************************************************************/
-gplugin_manager_real_append_path(GPluginManager *manager,
+gplugin_manager_real_append_path(GPluginManager *manager, const gchar *path) @@ -202,8 +228,7 @@
-gplugin_manager_real_prepend_path(GPluginManager *manager,
+gplugin_manager_real_prepend_path(GPluginManager *manager, const gchar *path) @@ -218,8 +243,7 @@
-gplugin_manager_real_remove_path(GPluginManager *manager,
+gplugin_manager_real_remove_path(GPluginManager *manager, const gchar *path) GList *l = NULL, *link = NULL;
@@ -236,18 +260,22 @@
-gplugin_manager_real_remove_paths(GPluginManager *manager) {
+gplugin_manager_real_remove_paths(GPluginManager *manager) g_queue_clear(manager->paths);
-gplugin_manager_real_get_paths(GPluginManager *manager) {
+gplugin_manager_real_get_paths(GPluginManager *manager) return manager->paths->head;
-gplugin_manager_real_register_loader(GPluginManager *manager, GType type,
+gplugin_manager_real_register_loader( + GPluginManager *manager, GPluginLoader *loader = NULL;
GSList *l = NULL, *exts = NULL;
@@ -256,23 +284,30 @@
loader = gplugin_manager_find_loader_by_type(manager, type);
if(GPLUGIN_IS_LOADER(loader)) {
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- _("loader %s was already registered"), g_type_name(type));
+ _("loader %s was already registered"), /* Create the loader instance first. If we can't create it, we bail */
loader = g_object_new(type, NULL);
if(!GPLUGIN_IS_LOADER(loader)) {
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- _("failed to create loader instance for %s"),
+ _("failed to create loader instance for %s"), - manager->loaders = g_slist_prepend(manager->loaders,
- g_object_ref(G_OBJECT(loader)));
+ g_slist_prepend(manager->loaders, g_object_ref(G_OBJECT(loader))); exts = gplugin_loader_get_supported_extensions(loader);
for(l = exts; l; l = l->next) {
@@ -299,8 +334,10 @@
existing = g_slist_prepend(existing, g_object_ref(G_OBJECT(loader)));
/* Now insert the updated slist back into the hash table */
- g_hash_table_insert(manager->loaders_by_extension, g_strdup(ext),
+ manager->loaders_by_extension, @@ -314,8 +351,10 @@
-gplugin_manager_real_unregister_loader(GPluginManager *manager, GType type,
+gplugin_manager_real_unregister_loader( + GPluginManager *manager, GPluginLoader *loader = NULL;
GSList *l = NULL, *exts = NULL;
@@ -324,8 +363,12 @@
loader = gplugin_manager_find_loader_by_type(manager, type);
if(!GPLUGIN_IS_LOADER(loader)) {
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- _("loader %s is not registered"), g_type_name(type));
+ _("loader %s is not registered"), @@ -353,8 +396,10 @@
los = g_slist_remove(los, lo);
- g_hash_table_insert(manager->loaders_by_extension,
+ manager->loaders_by_extension, g_hash_table_remove(manager->loaders_by_extension, ext);
@@ -375,7 +420,8 @@
-gplugin_manager_real_refresh(GPluginManager *manager) {
+gplugin_manager_real_refresh(GPluginManager *manager) GList *error_messages = NULL, *l = NULL;
gchar *error_message = NULL;
@@ -414,25 +460,27 @@
/* Build the path and see if we need to probe it! */
filename = g_build_filename(path, e->filename, NULL);
- plugin = g_hash_table_lookup(manager->plugins_filename_view, filename);
+ plugin = g_hash_table_lookup( + manager->plugins_filename_view, if(plugin && GPLUGIN_IS_PLUGIN(plugin)) {
- GPluginPluginState state =
- gplugin_plugin_get_state(plugin);
+ GPluginPluginState state = gplugin_plugin_get_state(plugin); /* The plugin is in our "view", check its state. If it's
* queried or loaded, move on to the next one.
if(state == GPLUGIN_PLUGIN_STATE_QUERIED ||
- state == GPLUGIN_PLUGIN_STATE_LOADED)
+ state == GPLUGIN_PLUGIN_STATE_LOADED) { /* grab the list of loaders for this extension */
- l = g_hash_table_lookup(manager->loaders_by_extension, e->extension);
+ l = g_hash_table_lookup( + manager->loaders_by_extension, @@ -444,9 +492,8 @@
/* Try to probe the plugin with the current loader */
- plugin = gplugin_loader_query_plugin(loader,
+ gplugin_loader_query_plugin(loader, filename, &error); /* Check the GError, if it's set, output its message and
@@ -454,12 +501,14 @@
if(plugin == NULL || error) {
- g_strdup_printf(_("failed to query '%s' with " \
- "loader '%s': %s"), filename,
- G_OBJECT_TYPE_NAME(loader),
- (error) ? error->message : _("Unknown"));
- error_messages = g_list_prepend(error_messages, error_message);
+ error_message = g_strdup_printf( + _("failed to query '%s' with " + G_OBJECT_TYPE_NAME(loader), + (error) ? error->message : _("Unknown")); + g_list_prepend(error_messages, error_message); @@ -508,16 +557,18 @@
/* throw a warning if the info->id is NULL */
- g_strdup_printf(_("Plugin %s has a NULL id."),
- error_messages = g_list_prepend(error_messages, error_message);
+ error_message = g_strdup_printf( + _("Plugin %s has a NULL id."), + g_list_prepend(error_messages, error_message); /* now insert into our view */
- g_hash_table_replace(manager->plugins_filename_view,
- g_object_ref(G_OBJECT(plugin)));
+ manager->plugins_filename_view, + g_object_ref(G_OBJECT(plugin))); /* Grab the list of plugins with our id and prepend the new
* plugin to it before updating it.
@@ -544,26 +595,30 @@
- loaded = gplugin_loader_load_plugin(loader,
+ gplugin_loader_load_plugin(loader, plugin, &error);
- g_strdup_printf(_("failed to load %s during query: %s"),
- (error) ? error->message : _("Unknown"));
- error_messages = g_list_prepend(error_messages, error_message);
+ error_message = g_strdup_printf( + _("failed to load %s during query: %s"), + (error) ? error->message : _("Unknown")); + g_list_prepend(error_messages, error_message); - gplugin_plugin_set_state(plugin, GPLUGIN_PLUGIN_STATE_LOADED);
+ gplugin_plugin_set_state( + GPLUGIN_PLUGIN_STATE_LOADED); /* finally set the plugin state queried */
- gplugin_plugin_set_state(plugin, GPLUGIN_PLUGIN_STATE_QUERIED);
+ gplugin_plugin_set_state( + GPLUGIN_PLUGIN_STATE_QUERIED); /* if errors is greater than 0 set
* manager->refresh_needed to TRUE.
@@ -575,7 +630,6 @@
g_object_unref(G_OBJECT(info));
@@ -598,8 +652,7 @@
-gplugin_manager_real_find_plugins(GPluginManager *manager,
+gplugin_manager_real_find_plugins(GPluginManager *manager, const gchar *id) GSList *plugins_list = NULL, *l;
@@ -613,15 +666,16 @@
plugin = GPLUGIN_PLUGIN(l->data);
- plugins_list = g_slist_prepend(plugins_list,
- g_object_ref(G_OBJECT(plugin)));
+ g_slist_prepend(plugins_list, g_object_ref(G_OBJECT(plugin))); -gplugin_manager_real_list_plugins(GPluginManager *manager) {
+gplugin_manager_real_list_plugins(GPluginManager *manager) GQueue *queue = g_queue_new();
@@ -640,9 +694,10 @@
-gplugin_manager_load_dependencies(GPluginPlugin *plugin,
- GPluginPluginInfo *info,
+gplugin_manager_load_dependencies( + GPluginPluginInfo *info, GSList *dependencies = NULL, *l = NULL;
@@ -673,13 +728,14 @@
-gplugin_manager_real_get_plugin_dependencies(G_GNUC_UNUSED GPluginManager *manager,
+gplugin_manager_real_get_plugin_dependencies( + G_GNUC_UNUSED GPluginManager *manager, GPluginPluginInfo *info = NULL;
- const gchar * const *dependencies = NULL;
+ const gchar *const *dependencies = NULL; info = gplugin_plugin_get_info(plugin);
@@ -713,8 +769,7 @@
g_match_info_free(match);
/* now look for a plugin matching the id */
- matches = gplugin_manager_find_plugins_with_version(oid, oop,
+ matches = gplugin_manager_find_plugins_with_version(oid, oop, over); @@ -734,9 +789,13 @@
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- _("failed to find dependency %s for %s"),
- dependencies[i], gplugin_plugin_info_get_id(info));
+ _("failed to find dependency %s for %s"), + gplugin_plugin_info_get_id(info)); g_slist_free_full(ret, g_object_unref);
@@ -752,9 +811,10 @@
-gplugin_manager_real_load_plugin(GPluginManager *manager,
+gplugin_manager_real_load_plugin( + GPluginManager *manager, GPluginPluginInfo *info = NULL;
GPluginLoader *loader = NULL;
@@ -769,9 +829,12 @@
/* now try to get the plugin info from the plugin */
info = gplugin_plugin_get_info(plugin);
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- _("Plugin %s did not return value plugin info"),
- gplugin_plugin_get_filename(plugin));
+ _("Plugin %s did not return value plugin info"), + gplugin_plugin_get_filename(plugin)); gplugin_plugin_set_state(plugin, GPLUGIN_PLUGIN_STATE_LOAD_FAILED);
@@ -790,10 +853,13 @@
loader = gplugin_plugin_get_loader(plugin);
if(!GPLUGIN_IS_LOADER(loader)) {
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- _("The loader for %s is not a loader. This "
- "should not happened!"),
- gplugin_plugin_get_filename(plugin));
+ _("The loader for %s is not a loader. This " + "should not happened!"), + gplugin_plugin_get_filename(plugin)); gplugin_plugin_set_state(plugin, GPLUGIN_PLUGIN_STATE_LOAD_FAILED);
@@ -808,8 +874,9 @@
ret = gplugin_loader_load_plugin(loader, plugin, error);
- gplugin_plugin_set_state(plugin, (ret) ? GPLUGIN_PLUGIN_STATE_LOADED :
- GPLUGIN_PLUGIN_STATE_LOAD_FAILED);
+ gplugin_plugin_set_state( + (ret) ? GPLUGIN_PLUGIN_STATE_LOADED : GPLUGIN_PLUGIN_STATE_LOAD_FAILED); g_signal_emit(manager, signals[SIG_LOADED], 0, plugin);
@@ -820,9 +887,10 @@
-gplugin_manager_real_unload_plugin(GPluginManager *manager,
+gplugin_manager_real_unload_plugin( + GPluginManager *manager, GPluginLoader *loader = NULL;
@@ -834,8 +902,11 @@
loader = gplugin_plugin_get_loader(plugin);
if(!GPLUGIN_IS_LOADER(loader)) {
- g_set_error_literal(error, GPLUGIN_DOMAIN, 0,
- _("Plugin loader is not a loader"));
+ _("Plugin loader is not a loader")); @@ -855,17 +926,19 @@
-gplugin_manager_loading_cb(G_GNUC_UNUSED GObject *manager,
- G_GNUC_UNUSED GPluginPlugin *plugin,
- G_GNUC_UNUSED GError **error)
+gplugin_manager_loading_cb( + G_GNUC_UNUSED GObject *manager, + G_GNUC_UNUSED GPluginPlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_manager_unloading_cb(G_GNUC_UNUSED GObject *manager,
- G_GNUC_UNUSED GPluginPlugin *plugin,
- G_GNUC_UNUSED GError **error)
+gplugin_manager_unloading_cb( + G_GNUC_UNUSED GObject *manager, + G_GNUC_UNUSED GPluginPlugin *plugin, + G_GNUC_UNUSED GError **error) @@ -874,16 +947,18 @@
*****************************************************************************/
-gplugin_manager_finalize(GObject *obj) {
+gplugin_manager_finalize(GObject *obj) GPluginManager *manager = GPLUGIN_MANAGER(obj);
g_queue_free_full(manager->paths, g_free);
/* free all the data in the plugins hash table and destroy it */
- g_hash_table_foreach_remove(manager->plugins,
- gplugin_manager_remove_list_value,
+ g_hash_table_foreach_remove( + gplugin_manager_remove_list_value, g_clear_pointer(&manager->plugins, g_hash_table_destroy);
/* destroy the filename view */
@@ -894,9 +969,10 @@
/* free all the data in the loaders hash table and destroy it */
- g_hash_table_foreach_remove(manager->loaders_by_extension,
- gplugin_manager_remove_list_value,
+ g_hash_table_foreach_remove( + manager->loaders_by_extension, + gplugin_manager_remove_list_value, g_clear_pointer(&manager->loaders_by_extension, g_hash_table_destroy);
/* call the base class's destructor */
@@ -904,10 +980,10 @@
-gplugin_manager_class_init(GPluginManagerClass *klass) {
+gplugin_manager_class_init(GPluginManagerClass *klass) GObjectClass *obj_class = G_OBJECT_CLASS(klass);
- GPluginManagerClass *manager_class =
- GPLUGIN_MANAGER_CLASS(klass);
+ GPluginManagerClass *manager_class = GPLUGIN_MANAGER_CLASS(klass); obj_class->finalize = gplugin_manager_finalize;
@@ -917,17 +993,16 @@
manager_class->remove_paths = gplugin_manager_real_remove_paths;
manager_class->get_paths = gplugin_manager_real_get_paths;
- manager_class->register_loader =
- gplugin_manager_real_register_loader;
- manager_class->unregister_loader =
- gplugin_manager_real_unregister_loader;
+ manager_class->register_loader = gplugin_manager_real_register_loader; + manager_class->unregister_loader = gplugin_manager_real_unregister_loader; manager_class->refresh = gplugin_manager_real_refresh;
manager_class->find_plugins = gplugin_manager_real_find_plugins;
manager_class->list_plugins = gplugin_manager_real_list_plugins;
- manager_class->get_plugin_dependencies = gplugin_manager_real_get_plugin_dependencies;
+ manager_class->get_plugin_dependencies = + gplugin_manager_real_get_plugin_dependencies; manager_class->load_plugin = gplugin_manager_real_load_plugin;
manager_class->unload_plugin = gplugin_manager_real_unload_plugin;
@@ -947,17 +1022,18 @@
* Return FALSE to stop loading
- g_signal_new("loading-plugin",
- G_OBJECT_CLASS_TYPE(manager_class),
- G_STRUCT_OFFSET(GPluginManagerClass,
- gplugin_boolean_accumulator, NULL,
- G_TYPE_OBJECT, G_TYPE_POINTER);
+ signals[SIG_LOADING] = g_signal_new( + G_OBJECT_CLASS_TYPE(manager_class), + G_STRUCT_OFFSET(GPluginManagerClass, loading_plugin), + gplugin_boolean_accumulator, * GPluginManager::loaded-plugin:
@@ -966,17 +1042,17 @@
* emitted after a plugin is loaded.
- g_signal_new("loaded-plugin",
- G_OBJECT_CLASS_TYPE(manager_class),
- G_STRUCT_OFFSET(GPluginManagerClass,
+ signals[SIG_LOADED] = g_signal_new( + G_OBJECT_CLASS_TYPE(manager_class), + G_STRUCT_OFFSET(GPluginManagerClass, loaded_plugin), * GPluginManager::load-failed:
@@ -985,17 +1061,17 @@
* emitted after a plugin fails to load.
- signals[SIG_LOAD_FAILED] =
- g_signal_new("load-failed",
- G_OBJECT_CLASS_TYPE(manager_class),
- G_STRUCT_OFFSET(GPluginManagerClass, load_failed),
+ signals[SIG_LOAD_FAILED] = g_signal_new( + G_OBJECT_CLASS_TYPE(manager_class), + G_STRUCT_OFFSET(GPluginManagerClass, load_failed), * GPluginManager::unloading-plugin:
@@ -1006,17 +1082,18 @@
* Return FALSE to stop unloading
- signals[SIG_UNLOADING] =
- g_signal_new("unloading-plugin",
- G_OBJECT_CLASS_TYPE(manager_class),
- G_STRUCT_OFFSET(GPluginManagerClass,
- gplugin_boolean_accumulator, NULL,
- G_TYPE_OBJECT, G_TYPE_POINTER);
+ signals[SIG_UNLOADING] = g_signal_new( + G_OBJECT_CLASS_TYPE(manager_class), + G_STRUCT_OFFSET(GPluginManagerClass, unloading_plugin), + gplugin_boolean_accumulator, * GPluginManager::unloaded-plugin:
@@ -1025,21 +1102,22 @@
* emitted after a plugin is unloaded.
- signals[SIG_UNLOADED] =
- g_signal_new("unloaded-plugin",
- G_OBJECT_CLASS_TYPE(manager_class),
- G_STRUCT_OFFSET(GPluginManagerClass,
+ signals[SIG_UNLOADED] = g_signal_new( + G_OBJECT_CLASS_TYPE(manager_class), + G_STRUCT_OFFSET(GPluginManagerClass, unloaded_plugin), -gplugin_manager_init(GPluginManager *manager) {
+gplugin_manager_init(GPluginManager *manager) manager->paths = g_queue_new();
/* the plugins hashtable is keyed on a plugin id and holds a GSList of all
@@ -1065,19 +1143,22 @@
* to use by the filename and helps us to avoid iterating the loaders table
- manager->loaders_by_extension =
- g_hash_table_new_full(gplugin_manager_str_hash, g_str_equal,
+ manager->loaders_by_extension = g_hash_table_new_full( + gplugin_manager_str_hash, /******************************************************************************
*****************************************************************************/
-gplugin_manager_private_init(void) {
+gplugin_manager_private_init(void) - if (instance != NULL) {
@@ -1096,7 +1177,8 @@
-gplugin_manager_private_uninit(void) {
+gplugin_manager_private_uninit(void) g_regex_unref(dependency_regex);
g_clear_object(&instance);
@@ -1113,7 +1195,8 @@
* Adds @path to the end of the list of paths to search for plugins.
-gplugin_manager_append_path(const gchar *path) {
+gplugin_manager_append_path(const gchar *path) GPluginManager *manager = GPLUGIN_MANAGER_INSTANCE;
GPluginManagerClass *klass = NULL;
@@ -1132,7 +1215,8 @@
* Adds @path to the beginning of the list of paths to search for plugins.
-gplugin_manager_prepend_path(const gchar *path) {
+gplugin_manager_prepend_path(const gchar *path) GPluginManager *manager = GPLUGIN_MANAGER_INSTANCE;
GPluginManagerClass *klass = NULL;
@@ -1151,7 +1235,8 @@
* Removes @path from the list of paths to search for plugins.
-gplugin_manager_remove_path(const gchar *path) {
+gplugin_manager_remove_path(const gchar *path) GPluginManager *manager = GPLUGIN_MANAGER_INSTANCE;
GPluginManagerClass *klass = NULL;
@@ -1169,7 +1254,8 @@
* Clears all paths that are set to search for plugins.
-gplugin_manager_remove_paths(void) {
+gplugin_manager_remove_paths(void) GPluginManager *manager = GPLUGIN_MANAGER_INSTANCE;
GPluginManagerClass *klass = NULL;
@@ -1189,7 +1275,8 @@
-gplugin_manager_add_default_paths(void) {
+gplugin_manager_add_default_paths(void) path = g_build_filename(PREFIX, LIBDIR, "gplugin", NULL);
@@ -1201,7 +1288,6 @@
* gplugin_manager_add_app_paths:
* @prefix: The installation prefix for the application.
@@ -1212,8 +1298,7 @@
* `${XDG_CONFIG_HOME}/@appname/plugins`.
-gplugin_manager_add_app_paths(const gchar *prefix,
+gplugin_manager_add_app_paths(const gchar *prefix, const gchar *appname) @@ -1237,7 +1322,8 @@
* be searched for plugins.
-gplugin_manager_get_paths(void) {
+gplugin_manager_get_paths(void) GPluginManager *manager = GPLUGIN_MANAGER_INSTANCE;
GPluginManagerClass *klass = NULL;
@@ -1261,7 +1347,8 @@
-gplugin_manager_register_loader(GType type, GError **error) {
+gplugin_manager_register_loader(GType type, GError **error) GPluginManager *manager = GPLUGIN_MANAGER_INSTANCE;
GPluginManagerClass *klass = NULL;
@@ -1271,8 +1358,11 @@
if(klass && klass->register_loader)
return klass->register_loader(manager, type, error);
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- "register_loader method not implemented");
+ "register_loader method not implemented"); @@ -1288,7 +1378,8 @@
* otherwise with @error set.
-gplugin_manager_unregister_loader(GType type, GError **error) {
+gplugin_manager_unregister_loader(GType type, GError **error) GPluginManager *manager = GPLUGIN_MANAGER_INSTANCE;
GPluginManagerClass *klass = NULL;
@@ -1298,8 +1389,11 @@
if(klass && klass->unregister_loader)
return klass->unregister_loader(manager, type, error);
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- "unregister_loader method not implemented");
+ "unregister_loader method not implemented"); @@ -1310,7 +1404,8 @@
* Forces a refresh of all plugins found in the search paths.
-gplugin_manager_refresh(void) {
+gplugin_manager_refresh(void) GPluginManager *manager = GPLUGIN_MANAGER_INSTANCE;
GPluginManagerClass *klass = NULL;
@@ -1333,7 +1428,8 @@
* the returned value when you're done with it.
-gplugin_manager_find_plugins(const gchar *id) {
+gplugin_manager_find_plugins(const gchar *id) GPluginManager *manager = GPLUGIN_MANAGER_INSTANCE;
GPluginManagerClass *klass = NULL;
@@ -1363,8 +1459,10 @@
* the returned value when you're done with it.
-gplugin_manager_find_plugins_with_version(const gchar *id, const gchar *op,
+gplugin_manager_find_plugins_with_version( GPluginManager *manager = GPLUGIN_MANAGER_INSTANCE;
GSList *plugins = NULL, *filtered = NULL, *l = NULL;
@@ -1399,9 +1497,10 @@
result = gplugin_version_compare(found_version, version, &error);
- g_warning("failed to compare versions for %s: %s",
- error->message ? error->message : _("unknown error"));
+ "failed to compare versions for %s: %s", + error->message ? error->message : _("unknown error")); @@ -1411,14 +1510,16 @@
keep = (g_strcmp0(op, "<") == 0 || g_strcmp0(op, "<=") == 0);
- keep = (g_strcmp0(op, "=") == 0 || g_strcmp0(op, "==") == 0 ||
- g_strcmp0(op, "<=") == 0 || g_strcmp0(op, ">=") == 0);
+ (g_strcmp0(op, "=") == 0 || g_strcmp0(op, "==") == 0 || + g_strcmp0(op, "<=") == 0 || g_strcmp0(op, ">=") == 0); keep = (g_strcmp0(op, ">") == 0 || g_strcmp0(op, ">=") == 0);
- filtered = g_slist_prepend(filtered, g_object_ref(G_OBJECT(plugin)));
+ g_slist_prepend(filtered, g_object_ref(G_OBJECT(plugin))); @@ -1439,7 +1540,8 @@
* if no plugin matching @id was found.
-gplugin_manager_find_plugin(const gchar *id) {
+gplugin_manager_find_plugin(const gchar *id) GSList *plugins_list = NULL;
GPluginPlugin *plugin = NULL;
@@ -1470,7 +1572,8 @@
-gplugin_manager_get_plugin_dependencies(GPluginPlugin *plugin, GError **error) {
+gplugin_manager_get_plugin_dependencies(GPluginPlugin *plugin, GError **error) GPluginManager *manager = NULL;
GPluginManagerClass *klass = NULL;
@@ -1500,7 +1603,8 @@
-gplugin_manager_load_plugin(GPluginPlugin *plugin, GError **error) {
+gplugin_manager_load_plugin(GPluginPlugin *plugin, GError **error) GPluginManager *manager = NULL;
GPluginManagerClass *klass = NULL;
@@ -1527,7 +1631,8 @@
-gplugin_manager_unload_plugin(GPluginPlugin *plugin, GError **error) {
+gplugin_manager_unload_plugin(GPluginPlugin *plugin, GError **error) GPluginManager *manager = NULL;
GPluginManagerClass *klass = NULL;
@@ -1553,7 +1658,8 @@
-gplugin_manager_list_plugins(void) {
+gplugin_manager_list_plugins(void) GPluginManager *manager = GPLUGIN_MANAGER_INSTANCE;
GPluginManagerClass *klass = NULL;
@@ -1566,7 +1672,6 @@
* gplugin_manager_get_instance:
@@ -1580,7 +1685,8 @@
-gplugin_manager_get_instance(void) {
+gplugin_manager_get_instance(void) return G_OBJECT(instance);
--- a/gplugin/gplugin-manager.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-manager.h Wed Feb 26 03:13:57 2020 -0600
@@ -22,8 +22,8 @@
#ifndef GPLUGIN_MANAGER_H
#define GPLUGIN_MANAGER_H
+#include <glib-object.h> -#include <glib-object.h>
#include <gplugin/gplugin-plugin.h>
@@ -45,11 +45,16 @@
void gplugin_manager_refresh(void);
GSList *gplugin_manager_find_plugins(const gchar *id);
-GSList *gplugin_manager_find_plugins_with_version(const gchar *id, const gchar *op, const gchar *version);
+GSList *gplugin_manager_find_plugins_with_version( GPluginPlugin *gplugin_manager_find_plugin(const gchar *id);
-GSList *gplugin_manager_get_plugin_dependencies(GPluginPlugin *plugin, GError **error);
+GSList *gplugin_manager_get_plugin_dependencies( gboolean gplugin_manager_load_plugin(GPluginPlugin *plugin, GError **error);
gboolean gplugin_manager_unload_plugin(GPluginPlugin *plugin, GError **error);
@@ -61,4 +66,3 @@
#endif /* GPLUGIN_MANAGER_H */
--- a/gplugin/gplugin-native-loader.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-native-loader.c Wed Feb 26 03:13:57 2020 -0600
@@ -59,16 +59,22 @@
*****************************************************************************/
-gplugin_native_loader_lookup_symbol(GModule *module,
- const gchar *name, GError **error)
+gplugin_native_loader_lookup_symbol( g_return_val_if_fail(module != NULL, NULL);
if(!g_module_symbol(module, name, &symbol)) {
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- _("symbol %s was not found"), name);
+ _("symbol %s was not found"), @@ -77,8 +83,10 @@
-gplugin_native_loader_open(const gchar *filename, GModuleFlags flags,
+gplugin_native_loader_open( @@ -89,9 +97,12 @@
const gchar *msg = g_module_error();
- *error = g_error_new(GPLUGIN_DOMAIN, 0,
- _("Failed to open plugin '%s': %s"),
- filename, (msg) ? msg : _("Unknown error"));
+ _("Failed to open plugin '%s': %s"), + (msg) ? msg : _("Unknown error")); @@ -101,7 +112,8 @@
* GPluginLoaderInterface API
*****************************************************************************/
-gplugin_native_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *l) {
+gplugin_native_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *l) GSList *exts = g_slist_append(NULL, G_MODULE_SUFFIX);
#if defined(__APPLE__) || defined(__MACH__)
@@ -116,25 +128,28 @@
static GPluginPluginInfo *
-gplugin_native_loader_open_and_query(const gchar *filename,
- GPluginNativePluginQueryFunc *query,
+gplugin_native_loader_open_and_query( + GPluginNativePluginQueryFunc *query, GPluginPluginInfo *info = NULL;
*module = gplugin_native_loader_open(filename, flags, error);
- } else if (error && *error) {
+ } else if(error && *error) { - *query = gplugin_native_loader_lookup_symbol(*module, GPLUGIN_QUERY_SYMBOL,
+ *query = gplugin_native_loader_lookup_symbol( if((*query == NULL) || (error && *error)) {
@@ -153,9 +168,10 @@
-gplugin_native_loader_query(GPluginLoader *loader,
+gplugin_native_loader_query( GPluginPlugin *plugin = NULL;
GPluginPluginInfo *info = NULL;
@@ -164,13 +180,20 @@
GPluginNativePluginUnloadFunc unload = NULL;
- info = gplugin_native_loader_open_and_query(filename, &module, 0, &query,
+ info = gplugin_native_loader_open_and_query( if(!GPLUGIN_IS_PLUGIN_INFO(info)) {
- if (error && *error == NULL) {
- g_set_error_literal(error, GPLUGIN_DOMAIN, 0,
- _("the query function did not return a "
- "GPluginPluginInfo instance"));
+ if(error && *error == NULL) { + _("the query function did not return a " + "GPluginPluginInfo instance")); @@ -180,14 +203,20 @@
g_object_unref(G_OBJECT(info));
- info = gplugin_native_loader_open_and_query(filename, &module,
+ info = gplugin_native_loader_open_and_query( if(!GPLUGIN_IS_PLUGIN_INFO(info)) {
- if (error && *error == NULL) {
- g_set_error_literal(error, GPLUGIN_DOMAIN, 0,
- _("the query function did not return a "
- "GPluginPluginInfo instance"));
+ if(error && *error == NULL) { + _("the query function did not return a " + "GPluginPluginInfo instance")); @@ -195,9 +224,8 @@
/* now look for the load symbol */
- load = gplugin_native_loader_lookup_symbol(module,
+ gplugin_native_loader_lookup_symbol(module, GPLUGIN_LOAD_SYMBOL, error); g_object_unref(G_OBJECT(info));
@@ -205,9 +233,10 @@
/* now look for the unload symbol */
- unload = gplugin_native_loader_lookup_symbol(module,
+ unload = gplugin_native_loader_lookup_symbol( g_object_unref(G_OBJECT(info));
@@ -234,8 +263,11 @@
g_object_unref(G_OBJECT(info));
if(!GPLUGIN_IS_NATIVE_PLUGIN(plugin)) {
- g_set_error_literal(error, GPLUGIN_DOMAIN, 0,
- _("failed to create plugin instance"));
+ _("failed to create plugin instance")); @@ -243,9 +275,10 @@
-gplugin_native_loader_load(G_GNUC_UNUSED GPluginLoader *loader,
+gplugin_native_loader_load( + G_GNUC_UNUSED GPluginLoader *loader, GPluginNativePluginLoadFunc func;
@@ -255,7 +288,7 @@
/* get and call the function */
g_object_get(G_OBJECT(plugin), "load-func", &func, NULL);
if(!func(GPLUGIN_NATIVE_PLUGIN(plugin), error)) {
- if (error && *error == NULL)
+ if(error && *error == NULL) g_set_error_literal(error, GPLUGIN_DOMAIN, 0, _("unknown failure"));
@@ -265,9 +298,10 @@
-gplugin_native_loader_unload(G_GNUC_UNUSED GPluginLoader *loader,
+gplugin_native_loader_unload( + G_GNUC_UNUSED GPluginLoader *loader, GPluginNativePluginUnloadFunc func;
@@ -288,7 +322,7 @@
/* now call the function */
if(!func(GPLUGIN_NATIVE_PLUGIN(plugin), error)) {
- if (error && *error == NULL)
+ if(error && *error == NULL) g_set_error_literal(error, GPLUGIN_DOMAIN, 0, _("unknown failure"));
@@ -298,13 +332,14 @@
-gplugin_native_loader_init(G_GNUC_UNUSED GPluginNativeLoader *loader) {
+gplugin_native_loader_init(G_GNUC_UNUSED GPluginNativeLoader *loader) -gplugin_native_loader_class_init(GPluginNativeLoaderClass *klass) {
- GPluginLoaderClass *loader_class =
- GPLUGIN_LOADER_CLASS(klass);
+gplugin_native_loader_class_init(GPluginNativeLoaderClass *klass) + GPluginLoaderClass *loader_class = GPLUGIN_LOADER_CLASS(klass); loader_class->supported_extensions =
gplugin_native_loader_supported_extensions;
--- a/gplugin/gplugin-native-loader.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-native-loader.h Wed Feb 26 03:13:57 2020 -0600
@@ -22,8 +22,8 @@
#ifndef GPLUGIN_NATIVE_LOADER_H
#define GPLUGIN_NATIVE_LOADER_H
+#include <glib-object.h> -#include <glib-object.h>
#include <gplugin/gplugin-loader.h>
@@ -32,7 +32,12 @@
#define GPLUGIN_TYPE_NATIVE_LOADER (gplugin_native_loader_get_type())
-G_DECLARE_FINAL_TYPE(GPluginNativeLoader, gplugin_native_loader, GPLUGIN, NATIVE_LOADER, GPluginLoader)
--- a/gplugin/gplugin-native-plugin.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-native-plugin.c Wed Feb 26 03:13:57 2020 -0600
@@ -71,13 +71,16 @@
-static GParamSpec *properties[N_PROPERTIES] = {NULL,};
+static GParamSpec *properties[N_PROPERTIES] = { /******************************************************************************
* GPluginPlugin Implementation
*****************************************************************************/
-gplugin_native_plugin_iface_init(G_GNUC_UNUSED GPluginPluginInterface *iface) {
+gplugin_native_plugin_iface_init(G_GNUC_UNUSED GPluginPluginInterface *iface) /* we just override properites from GPluginPlugin */
@@ -85,12 +88,14 @@
* GTypeModule Implementation
*****************************************************************************/
-gplugin_native_plugin_load(G_GNUC_UNUSED GTypeModule *module) {
+gplugin_native_plugin_load(G_GNUC_UNUSED GTypeModule *module) -gplugin_native_plugin_unload(G_GNUC_UNUSED GTypeModule *module) {
+gplugin_native_plugin_unload(G_GNUC_UNUSED GTypeModule *module) /******************************************************************************
@@ -100,19 +105,24 @@
- G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_native_plugin_iface_init)
+ gplugin_native_plugin_iface_init)); -gplugin_native_plugin_get_property(GObject *obj, guint param_id, GValue *value,
+gplugin_native_plugin_get_property( GPluginNativePlugin *plugin = GPLUGIN_NATIVE_PLUGIN(obj);
- g_value_set_pointer(value,
- gplugin_native_plugin_get_module(plugin));
+ gplugin_native_plugin_get_module(plugin)); g_value_set_pointer(value, plugin->load_func);
@@ -141,8 +151,11 @@
-gplugin_native_plugin_set_property(GObject *obj, guint param_id,
- const GValue *value, GParamSpec *pspec)
+gplugin_native_plugin_set_property( GPluginNativePlugin *plugin = GPLUGIN_NATIVE_PLUGIN(obj);
@@ -178,7 +191,8 @@
-gplugin_native_plugin_finalize(GObject *obj) {
+gplugin_native_plugin_finalize(GObject *obj) GPluginNativePlugin *plugin = GPLUGIN_NATIVE_PLUGIN(obj);
g_clear_pointer(&plugin->filename, g_free);
@@ -189,11 +203,13 @@
-gplugin_native_plugin_init(G_GNUC_UNUSED GPluginNativePlugin *plugin) {
+gplugin_native_plugin_init(G_GNUC_UNUSED GPluginNativePlugin *plugin) -gplugin_native_plugin_class_init(GPluginNativePluginClass *klass) {
+gplugin_native_plugin_class_init(GPluginNativePluginClass *klass) GObjectClass *obj_class = G_OBJECT_CLASS(klass);
GTypeModuleClass *module_class = G_TYPE_MODULE_CLASS(klass);
@@ -210,10 +226,10 @@
* The GModule instance for this plugin.
properties[PROP_MODULE] = g_param_spec_pointer(
- "module", "module handle",
"The GModule instance of the plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); * GPluginNativePlugin:load-func:
@@ -221,10 +237,10 @@
* A function pointer to the load method of the plugin.
properties[PROP_LOAD_FUNC] = g_param_spec_pointer(
- "load-func", "load function pointer",
+ "load function pointer", "address pointer to load function",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); * GPluginNativePlugin:unload-func:
@@ -232,10 +248,10 @@
* A function pointer to the unload method of the plugin.
properties[PROP_UNLOAD_FUNC] = g_param_spec_pointer(
- "unload-func", "unload function pointer",
+ "unload function pointer", "address pointer to the unload function",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
@@ -260,7 +276,8 @@
* Returns: The %GModule associated with this plugin.
-gplugin_native_plugin_get_module(GPluginNativePlugin *plugin) {
+gplugin_native_plugin_get_module(GPluginNativePlugin *plugin) g_return_val_if_fail(GPLUGIN_IS_NATIVE_PLUGIN(plugin), NULL);
--- a/gplugin/gplugin-native-plugin.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-native-plugin.h Wed Feb 26 03:13:57 2020 -0600
@@ -29,7 +29,12 @@
#define GPLUGIN_TYPE_NATIVE_PLUGIN (gplugin_native_plugin_get_type())
-G_DECLARE_FINAL_TYPE(GPluginNativePlugin, gplugin_native_plugin, GPLUGIN, NATIVE_PLUGIN, GTypeModule)
GModule *gplugin_native_plugin_get_module(GPluginNativePlugin *plugin);
--- a/gplugin/gplugin-native-private.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-native-private.h Wed Feb 26 03:13:57 2020 -0600
@@ -29,8 +29,11 @@
typedef GPluginPluginInfo *(*GPluginNativePluginQueryFunc)(GError **error);
-typedef gboolean (*GPluginNativePluginLoadFunc)(GPluginNativePlugin *plugin, GError **error);
-typedef gboolean (*GPluginNativePluginUnloadFunc)(GPluginNativePlugin *plugin, GError **error);
+ *GPluginNativePluginLoadFunc)(GPluginNativePlugin *plugin, GError **error); +typedef gboolean (*GPluginNativePluginUnloadFunc)( + GPluginNativePlugin *plugin, --- a/gplugin/gplugin-options.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-options.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,9 +15,9 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <glib-object.h> #include <glib/gi18n-lib.h>
-#include <glib-object.h>
#include <gplugin/gplugin-options.h>
@@ -41,10 +41,11 @@
static gchar **paths = NULL;
-gplugin_options_no_default_paths_cb(G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
- G_GNUC_UNUSED gpointer d,
- G_GNUC_UNUSED GError **e)
+gplugin_options_no_default_paths_cb( + G_GNUC_UNUSED const gchar *n, + G_GNUC_UNUSED const gchar *v, + G_GNUC_UNUSED gpointer d, + G_GNUC_UNUSED GError **e) add_default_paths = FALSE;
@@ -69,10 +70,11 @@
-gplugin_options_post_parse_cb(G_GNUC_UNUSED GOptionContext *ctx,
- G_GNUC_UNUSED GOptionGroup *group,
- G_GNUC_UNUSED gpointer data,
- G_GNUC_UNUSED GError **error)
+gplugin_options_post_parse_cb( + G_GNUC_UNUSED GOptionContext *ctx, + G_GNUC_UNUSED GOptionGroup *group, + G_GNUC_UNUSED gpointer data, + G_GNUC_UNUSED GError **error) @@ -106,14 +108,18 @@
-gplugin_get_option_group(void) {
+gplugin_get_option_group(void) GOptionGroup *group = NULL;
- group = g_option_group_new("gplugin", _("GPlugin Options"),
- _("Show GPlugin Options"), NULL, NULL);
+ group = g_option_group_new( + _("Show GPlugin Options"), - g_option_group_set_parse_hooks(group, NULL,
- gplugin_options_post_parse_cb);
+ g_option_group_set_parse_hooks(group, NULL, gplugin_options_post_parse_cb); g_option_group_add_entries(group, entries);
g_option_group_set_translation_domain(group, GETTEXT_PACKAGE);
--- a/gplugin/gplugin-plugin-info.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-plugin-info.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,8 +15,8 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin/gplugin-core.h> #include <gplugin/gplugin-plugin-info.h>
-#include <gplugin/gplugin-core.h>
#include <gplugin/gplugin-enums.h>
#include <gplugin/gplugin-private.h>
@@ -103,147 +103,173 @@
-static GParamSpec *properties[N_PROPERTIES] = {NULL,};
+static GParamSpec *properties[N_PROPERTIES] = { -G_DEFINE_TYPE_WITH_PRIVATE(GPluginPluginInfo, gplugin_plugin_info, G_TYPE_INITIALLY_UNOWNED)
+G_DEFINE_TYPE_WITH_PRIVATE( + G_TYPE_INITIALLY_UNOWNED) /******************************************************************************
*****************************************************************************/
-gplugin_plugin_info_set_id(GPluginPluginInfo *info, const gchar *id) {
- GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+gplugin_plugin_info_set_id(GPluginPluginInfo *info, const gchar *id) + GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); -gplugin_plugin_info_set_abi_version(GPluginPluginInfo *info,
+gplugin_plugin_info_set_abi_version( + GPluginPluginInfo *info, - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); priv->abi_version = abi_version;
-gplugin_plugin_info_set_internal(GPluginPluginInfo *info, gboolean internal) {
- GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+gplugin_plugin_info_set_internal(GPluginPluginInfo *info, gboolean internal) + GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); priv->internal = internal;
-gplugin_plugin_info_set_load_on_query(GPluginPluginInfo *info, gboolean loq) {
- GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+gplugin_plugin_info_set_load_on_query(GPluginPluginInfo *info, gboolean loq) + GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); priv->load_on_query = loq;
-gplugin_plugin_info_set_bind_local(GPluginPluginInfo *info,
+gplugin_plugin_info_set_bind_local(GPluginPluginInfo *info, gboolean bind_local) - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); priv->bind_local = bind_local;
-gplugin_plugin_info_set_name(GPluginPluginInfo *info, const gchar *name) {
- GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+gplugin_plugin_info_set_name(GPluginPluginInfo *info, const gchar *name) + GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); priv->name = g_strdup(name);
-gplugin_plugin_info_set_version(GPluginPluginInfo *info,
+gplugin_plugin_info_set_version(GPluginPluginInfo *info, const gchar *version) - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); priv->version = g_strdup(version);
-gplugin_plugin_info_set_license_id(GPluginPluginInfo *info,
- const gchar *license_id)
+gplugin_plugin_info_set_license_id( + GPluginPluginInfo *info, + const gchar *license_id) - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); g_free(priv->license_id);
priv->license_id = g_strdup(license_id);
-gplugin_plugin_info_set_license_text(GPluginPluginInfo *info,
- const gchar *license_text)
+gplugin_plugin_info_set_license_text( + GPluginPluginInfo *info, + const gchar *license_text) - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); g_free(priv->license_text);
priv->license_text = g_strdup(license_text);
-gplugin_plugin_info_set_license_url(GPluginPluginInfo *info,
- const gchar *license_url)
+gplugin_plugin_info_set_license_url( + GPluginPluginInfo *info, + const gchar *license_url) - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); g_free(priv->license_url);
priv->license_url = g_strdup(license_url);
-gplugin_plugin_info_set_icon_name(GPluginPluginInfo *info,
- const gchar *icon_name)
+gplugin_plugin_info_set_icon_name( + GPluginPluginInfo *info, + const gchar *icon_name) - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); priv->icon_name = g_strdup(icon_name);
-gplugin_plugin_info_set_summary(GPluginPluginInfo *info,
+gplugin_plugin_info_set_summary(GPluginPluginInfo *info, const gchar *summary) - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); priv->summary = g_strdup(summary);
-gplugin_plugin_info_set_description(GPluginPluginInfo *info,
- const gchar *description)
+gplugin_plugin_info_set_description( + GPluginPluginInfo *info, + const gchar *description) - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); g_free(priv->description);
priv->description = g_strdup(description);
-gplugin_plugin_info_set_category(GPluginPluginInfo *info,
+gplugin_plugin_info_set_category(GPluginPluginInfo *info, const gchar *category) - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); priv->category = g_strdup(category);
-gplugin_plugin_info_set_authors(GPluginPluginInfo *info,
- const gchar * const *authors) {
- GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+gplugin_plugin_info_set_authors( + GPluginPluginInfo *info, + const gchar *const *authors) + GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); g_strfreev(priv->authors);
@@ -251,20 +277,22 @@
-gplugin_plugin_info_set_website(GPluginPluginInfo *info,
+gplugin_plugin_info_set_website(GPluginPluginInfo *info, const gchar *website) - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); priv->website = g_strdup(website);
-gplugin_plugin_info_set_dependencies(GPluginPluginInfo *info,
- const gchar * const *dependencies)
+gplugin_plugin_info_set_dependencies( + GPluginPluginInfo *info, + const gchar *const *dependencies) - GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(info);
+ GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(info); g_strfreev(priv->dependencies);
@@ -275,8 +303,11 @@
*****************************************************************************/
-gplugin_plugin_info_get_property(GObject *obj, guint param_id, GValue *value,
+gplugin_plugin_info_get_property( GPluginPluginInfo *info = GPLUGIN_PLUGIN_INFO(obj);
@@ -291,12 +322,14 @@
g_value_set_boolean(value, gplugin_plugin_info_get_internal(info));
- g_value_set_boolean(value,
- gplugin_plugin_info_get_load_on_query(info));
+ gplugin_plugin_info_get_load_on_query(info)); - g_value_set_boolean(value,
- gplugin_plugin_info_get_bind_local(info));
+ gplugin_plugin_info_get_bind_local(info)); g_value_set_string(value, gplugin_plugin_info_get_name(info));
@@ -305,16 +338,17 @@
g_value_set_string(value, gplugin_plugin_info_get_version(info));
- g_value_set_string(value,
- gplugin_plugin_info_get_license_id(info));
+ g_value_set_string(value, gplugin_plugin_info_get_license_id(info)); - g_value_set_string(value,
- gplugin_plugin_info_get_license_text(info));
+ gplugin_plugin_info_get_license_text(info)); - g_value_set_string(value,
- gplugin_plugin_info_get_license_url(info));
+ gplugin_plugin_info_get_license_url(info)); g_value_set_string(value, gplugin_plugin_info_get_icon_name(info));
@@ -323,8 +357,9 @@
g_value_set_string(value, gplugin_plugin_info_get_summary(info));
- g_value_set_string(value,
- gplugin_plugin_info_get_description(info));
+ gplugin_plugin_info_get_description(info)); g_value_set_string(value, gplugin_plugin_info_get_category(info));
@@ -336,8 +371,9 @@
g_value_set_string(value, gplugin_plugin_info_get_website(info));
- g_value_set_boxed(value,
- gplugin_plugin_info_get_dependencies(info));
+ gplugin_plugin_info_get_dependencies(info)); G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
@@ -346,8 +382,11 @@
-gplugin_plugin_info_set_property(GObject *obj, guint param_id,
- const GValue *value, GParamSpec *pspec)
+gplugin_plugin_info_set_property( GPluginPluginInfo *info = GPLUGIN_PLUGIN_INFO(obj);
@@ -362,12 +401,14 @@
gplugin_plugin_info_set_internal(info, g_value_get_boolean(value));
- gplugin_plugin_info_set_load_on_query(info,
- g_value_get_boolean(value));
+ gplugin_plugin_info_set_load_on_query( + g_value_get_boolean(value)); - gplugin_plugin_info_set_bind_local(info,
- g_value_get_boolean(value));
+ gplugin_plugin_info_set_bind_local( + g_value_get_boolean(value)); gplugin_plugin_info_set_name(info, g_value_get_string(value));
@@ -376,16 +417,17 @@
gplugin_plugin_info_set_version(info, g_value_get_string(value));
- gplugin_plugin_info_set_license_id(info,
- g_value_get_string(value));
+ gplugin_plugin_info_set_license_id(info, g_value_get_string(value)); - gplugin_plugin_info_set_license_text(info,
- g_value_get_string(value));
+ gplugin_plugin_info_set_license_text( + g_value_get_string(value)); - gplugin_plugin_info_set_license_url(info,
- g_value_get_string(value));
+ gplugin_plugin_info_set_license_url( + g_value_get_string(value)); gplugin_plugin_info_set_icon_name(info, g_value_get_string(value));
@@ -394,8 +436,9 @@
gplugin_plugin_info_set_summary(info, g_value_get_string(value));
- gplugin_plugin_info_set_description(info,
- g_value_get_string(value));
+ gplugin_plugin_info_set_description( + g_value_get_string(value)); gplugin_plugin_info_set_category(info, g_value_get_string(value));
@@ -407,8 +450,9 @@
gplugin_plugin_info_set_website(info, g_value_get_string(value));
- gplugin_plugin_info_set_dependencies(info,
- g_value_get_boxed(value));
+ gplugin_plugin_info_set_dependencies( + g_value_get_boxed(value)); G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
@@ -417,8 +461,10 @@
-gplugin_plugin_info_finalize(GObject *obj) {
- GPluginPluginInfoPrivate *priv = gplugin_plugin_info_get_instance_private(GPLUGIN_PLUGIN_INFO(obj));
+gplugin_plugin_info_finalize(GObject *obj) + GPluginPluginInfoPrivate *priv = + gplugin_plugin_info_get_instance_private(GPLUGIN_PLUGIN_INFO(obj)); g_clear_pointer(&priv->id, g_free);
g_clear_pointer(&priv->name, g_free);
@@ -437,11 +483,13 @@
-gplugin_plugin_info_init(G_GNUC_UNUSED GPluginPluginInfo *info) {
+gplugin_plugin_info_init(G_GNUC_UNUSED GPluginPluginInfo *info) -gplugin_plugin_info_class_init(GPluginPluginInfoClass *klass) {
+gplugin_plugin_info_class_init(GPluginPluginInfoClass *klass) GObjectClass *obj_class = G_OBJECT_CLASS(klass);
obj_class->get_property = gplugin_plugin_info_get_property;
@@ -461,12 +509,11 @@
* "gplugin/python3-loader".
properties[PROP_ID] = g_param_spec_string(
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:abi-version:
@@ -488,11 +535,13 @@
properties[PROP_ABI_VERSION] = g_param_spec_uint(
- "abi-version", "abi_version",
"The ABI version of the plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:internal:
@@ -502,11 +551,11 @@
properties[PROP_INTERNAL] = g_param_spec_boolean(
- "internal", "internal",
"Whether or not the plugin is an internal plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); * GPluginPluginInfo:load-on-query:
@@ -519,11 +568,11 @@
properties[PROP_LOQ] = g_param_spec_boolean(
- "load-on-query", "load-on-query",
"Whether or not the plugin should be loaded when queried",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); * GPluginPluginInfo:bind-local:
@@ -533,11 +582,11 @@
* Note: This should only be used by the native plugin loader.
properties[PROP_BIND_LOCAL] = g_param_spec_boolean(
- "bind-local", "bind-local",
"Whether symbols should be bound locally",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); * GPluginPluginInfo:name:
@@ -545,11 +594,11 @@
* The display name of the plugin. This should be a translated string.
properties[PROP_NAME] = g_param_spec_string(
"The name of the plugin",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:version:
@@ -557,11 +606,11 @@
* The version of the plugin. Preferably a semantic version.
properties[PROP_VERSION] = g_param_spec_string(
"The version of the plugin",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:license-id:
@@ -577,11 +626,11 @@
* the same time, they should be separated by an ampersand (&).
properties[PROP_LICENSE_ID] = g_param_spec_string(
- "license-id", "license-id",
"The license id of the plugin according to SPDX",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:license-text:
@@ -590,11 +639,11 @@
* the plugin is licensed under a license that is not listed at spdx.org.
properties[PROP_LICENSE_TEXT] = g_param_spec_string(
- "license-text", "license text",
"The text of the license for the plugin",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:license-url:
@@ -603,11 +652,11 @@
* for licenses not listed at spdx.org.
properties[PROP_LICENSE_URL] = g_param_spec_string(
- "license-url", "license url",
"The url to the license of the plugin",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:icon-name:
@@ -616,11 +665,11 @@
* the application/library using GPlugin.
properties[PROP_ICON_NAME] = g_param_spec_string(
- "icon-name", "icon-name",
"The XDG icon name for the plugin",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:summary:
@@ -629,11 +678,11 @@
properties[PROP_SUMMARY] = g_param_spec_string(
"The summary of the plugin",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:description:
@@ -642,11 +691,11 @@
* information" section in a user interface.
properties[PROP_DESCRIPTION] = g_param_spec_string(
- "description", "description",
"The description of the plugin",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:category:
@@ -659,11 +708,11 @@
* that don't match this category into an "Other" category.
properties[PROP_CATEGORY] = g_param_spec_string(
- "category", "category",
"The category of the plugin",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:authors:
@@ -674,11 +723,11 @@
* `"First Last <user@domain.com>"`.
properties[PROP_AUTHORS] = g_param_spec_boxed(
"The authors of the plugin",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:website:
@@ -686,11 +735,11 @@
* The url of the plugin that can be represented in a user interface.
properties[PROP_WEBSITE] = g_param_spec_string(
"The website of the plugin",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); * GPluginPluginInfo:dependencies:
@@ -698,11 +747,11 @@
* A comma separated list of plugin id's that this plugin depends on.
properties[PROP_DEPENDENCIES] = g_param_spec_boxed(
- "dependencies", "dependencies",
"The dependencies of the plugin",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
@@ -731,7 +780,8 @@
* Returns: The id from @info.
-gplugin_plugin_info_get_id(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_id(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
@@ -751,7 +801,8 @@
* Returns: The abi_version from @info.
-gplugin_plugin_info_get_abi_version(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_abi_version(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), 0);
@@ -772,7 +823,8 @@
* Returns: %TRUE if the plugin is internal, %FALSE otherwise.
-gplugin_plugin_info_get_internal(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_internal(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), FALSE);
@@ -794,7 +846,8 @@
* Returns: %TRUE if the plugin should be loaded on query, %FALSE otherwise.
-gplugin_plugin_info_get_load_on_query(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_load_on_query(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), FALSE);
@@ -813,7 +866,8 @@
* Returns: The name from @info.
-gplugin_plugin_info_get_name(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_name(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
@@ -832,7 +886,8 @@
* Returns: The version from @info.
-gplugin_plugin_info_get_version(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_version(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
@@ -851,7 +906,8 @@
* Returns: The license-id from @info.
-gplugin_plugin_info_get_license_id(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_license_id(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
@@ -870,7 +926,8 @@
* Returns: The text of the license from @info.
-gplugin_plugin_info_get_license_text(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_license_text(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
@@ -889,7 +946,8 @@
* Returns: The url of the license from @info.
-gplugin_plugin_info_get_license_url(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_license_url(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
@@ -908,7 +966,8 @@
* Returns: The icon name from @info.
-gplugin_plugin_info_get_icon_name(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_icon_name(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
@@ -927,7 +986,8 @@
* Returns: The summary from @info.
-gplugin_plugin_info_get_summary(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_summary(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
@@ -946,7 +1006,8 @@
* Returns: The description from @info.
-gplugin_plugin_info_get_description(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_description(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
@@ -965,7 +1026,8 @@
* Returns: The category from @info.
-gplugin_plugin_info_get_category(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_category(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
@@ -983,15 +1045,16 @@
* Returns: (array zero-terminated=1) (transfer none): The authors from @info.
-gplugin_plugin_info_get_authors(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_authors(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
priv = gplugin_plugin_info_get_instance_private(info);
- return (const gchar * const *)priv->authors;
+ return (const gchar *const *)priv->authors; @@ -1003,7 +1066,8 @@
* Returns: The website from @info.
-gplugin_plugin_info_get_website(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_website(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
@@ -1022,15 +1086,16 @@
* Returns: (array zero-terminated=1) (transfer none): The list of
* dependencies from @info.
-gplugin_plugin_info_get_dependencies(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_dependencies(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), NULL);
priv = gplugin_plugin_info_get_instance_private(info);
- return (const gchar * const *)priv->dependencies;
+ return (const gchar *const *)priv->dependencies; @@ -1043,7 +1108,8 @@
* bound locally, %FALSE if they should be bound globally.
-gplugin_plugin_info_get_bind_local(GPluginPluginInfo *info) {
+gplugin_plugin_info_get_bind_local(GPluginPluginInfo *info) GPluginPluginInfoPrivate *priv = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), FALSE);
--- a/gplugin/gplugin-plugin-info.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-plugin-info.h Wed Feb 26 03:13:57 2020 -0600
@@ -22,13 +22,18 @@
#ifndef GPLUGIN_PLUGIN_INFO_H
#define GPLUGIN_PLUGIN_INFO_H
+#include <glib-object.h> -#include <glib-object.h>
#define GPLUGIN_TYPE_PLUGIN_INFO (gplugin_plugin_info_get_type())
-G_DECLARE_DERIVABLE_TYPE(GPluginPluginInfo, gplugin_plugin_info, GPLUGIN, PLUGIN_INFO, GInitiallyUnowned)
+G_DECLARE_DERIVABLE_TYPE( #include <gplugin/gplugin-loader.h>
#include <gplugin/gplugin-version.h>
@@ -62,9 +67,10 @@
const gchar *gplugin_plugin_info_get_summary(GPluginPluginInfo *info);
const gchar *gplugin_plugin_info_get_description(GPluginPluginInfo *info);
const gchar *gplugin_plugin_info_get_category(GPluginPluginInfo *info);
-const gchar * const *gplugin_plugin_info_get_authors(GPluginPluginInfo *info);
+const gchar *const *gplugin_plugin_info_get_authors(GPluginPluginInfo *info); const gchar *gplugin_plugin_info_get_website(GPluginPluginInfo *info);
-const gchar * const *gplugin_plugin_info_get_dependencies(GPluginPluginInfo *info);
+const gchar *const *gplugin_plugin_info_get_dependencies( + GPluginPluginInfo *info); --- a/gplugin/gplugin-plugin.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-plugin.c Wed Feb 26 03:13:57 2020 -0600
@@ -71,7 +71,9 @@
-static guint signals[SIG_LAST] = {0, };
+static guint signals[SIG_LAST] = { G_DEFINE_INTERFACE(GPluginPlugin, gplugin_plugin, G_TYPE_INVALID);
@@ -79,7 +81,8 @@
*****************************************************************************/
-gplugin_plugin_default_init(GPluginPluginInterface *iface) {
+gplugin_plugin_default_init(GPluginPluginInterface *iface) GParamSpec *pspec = NULL;
@@ -88,11 +91,11 @@
* The absolute path to the plugin on disk.
pspec = g_param_spec_string(
- "filename", "filename",
"The filename of the plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_interface_install_property(iface, pspec);
@@ -101,11 +104,11 @@
* The #GPluginLoader that loaded this plugin.
pspec = g_param_spec_object(
"The loader for this plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_interface_install_property(iface, pspec);
@@ -114,11 +117,11 @@
* The #GPluginPluginInfo from this plugin.
pspec = g_param_spec_object(
"The information for the plugin",
GPLUGIN_TYPE_PLUGIN_INFO,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_interface_install_property(iface, pspec);
@@ -127,12 +130,12 @@
* The #GPluginPluginState that this plugin is in.
pspec = g_param_spec_enum(
"The state of the plugin",
GPLUGIN_TYPE_PLUGIN_STATE,
GPLUGIN_PLUGIN_STATE_UNKNOWN,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT); g_object_interface_install_property(iface, pspec);
@@ -143,18 +146,18 @@
* Emitted when @plugin changes state.
- signals[SIG_STATE_CHANGED] =
- g_signal_new("state-changed",
- G_STRUCT_OFFSET(GPluginPluginInterface, state_changed),
- GPLUGIN_TYPE_PLUGIN_STATE,
- GPLUGIN_TYPE_PLUGIN_STATE);
+ signals[SIG_STATE_CHANGED] = g_signal_new( + G_STRUCT_OFFSET(GPluginPluginInterface, state_changed), + GPLUGIN_TYPE_PLUGIN_STATE, + GPLUGIN_TYPE_PLUGIN_STATE); /******************************************************************************
@@ -170,7 +173,8 @@
* Returns: (transfer full): The filename of @plugin.
-gplugin_plugin_get_filename(GPluginPlugin *plugin) {
+gplugin_plugin_get_filename(GPluginPlugin *plugin) g_return_val_if_fail(GPLUGIN_IS_PLUGIN(plugin), NULL);
@@ -189,7 +193,8 @@
* Returns: (transfer full): The #GPluginLoader that loaded @plugin.
-gplugin_plugin_get_loader(GPluginPlugin *plugin) {
+gplugin_plugin_get_loader(GPluginPlugin *plugin) GPluginLoader *loader = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN(plugin), NULL);
@@ -208,7 +213,8 @@
* Returns: (transfer full): The #GPluginPluginInfo instance for @plugin.
-gplugin_plugin_get_info(GPluginPlugin *plugin) {
+gplugin_plugin_get_info(GPluginPlugin *plugin) GPluginPluginInfo *info = NULL;
g_return_val_if_fail(GPLUGIN_IS_PLUGIN(plugin), NULL);
@@ -227,10 +233,13 @@
* Returns: (transfer full): The current state of @plugin.
-gplugin_plugin_get_state(GPluginPlugin *plugin) {
+gplugin_plugin_get_state(GPluginPlugin *plugin) GPluginPluginState state = GPLUGIN_PLUGIN_STATE_UNKNOWN;
- g_return_val_if_fail(GPLUGIN_IS_PLUGIN(plugin), GPLUGIN_PLUGIN_STATE_UNKNOWN);
+ GPLUGIN_IS_PLUGIN(plugin), + GPLUGIN_PLUGIN_STATE_UNKNOWN); g_object_get(G_OBJECT(plugin), "state", &state, NULL);
@@ -246,7 +255,8 @@
-gplugin_plugin_set_state(GPluginPlugin *plugin, GPluginPluginState state) {
+gplugin_plugin_set_state(GPluginPlugin *plugin, GPluginPluginState state) GPluginPluginState oldstate = GPLUGIN_PLUGIN_STATE_UNKNOWN;
g_return_if_fail(GPLUGIN_IS_PLUGIN(plugin));
@@ -255,6 +265,5 @@
g_object_set(G_OBJECT(plugin), "state", state, NULL);
- g_signal_emit(plugin, signals[SIG_STATE_CHANGED], 0,
+ g_signal_emit(plugin, signals[SIG_STATE_CHANGED], 0, oldstate, state); --- a/gplugin/gplugin-plugin.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-plugin.h Wed Feb 26 03:13:57 2020 -0600
@@ -22,19 +22,21 @@
+#include <glib-object.h> -#include <glib-object.h>
-typedef enum /*< prefix=GPLUGIN_PLUGIN_STATE,underscore_name=GPLUGIN_PLUGIN_STATE >*/ {
- GPLUGIN_PLUGIN_STATE_UNKNOWN = -1,
- GPLUGIN_PLUGIN_STATE_ERROR = 0,
- GPLUGIN_PLUGIN_STATE_QUERIED,
- GPLUGIN_PLUGIN_STATE_REQUERY,
- GPLUGIN_PLUGIN_STATE_LOADED,
- GPLUGIN_PLUGIN_STATE_LOAD_FAILED,
+ prefix=GPLUGIN_PLUGIN_STATE,underscore_name=GPLUGIN_PLUGIN_STATE +{ GPLUGIN_PLUGIN_STATE_UNKNOWN = -1, + GPLUGIN_PLUGIN_STATE_ERROR = 0, + GPLUGIN_PLUGIN_STATE_QUERIED, + GPLUGIN_PLUGIN_STATE_REQUERY, + GPLUGIN_PLUGIN_STATE_LOADED, + GPLUGIN_PLUGIN_STATE_LOAD_FAILED,
- GPLUGIN_PLUGIN_STATES, /*< skip >*/
+ GPLUGIN_PLUGIN_STATES, /*< skip >*/ @@ -43,15 +45,18 @@
G_DECLARE_INTERFACE(GPluginPlugin, gplugin_plugin, GPLUGIN, PLUGIN, GObject)
/* circular dependencies suck... */
+#include <gplugin/gplugin-loader.h> #include <gplugin/gplugin-plugin-info.h>
-#include <gplugin/gplugin-loader.h>
struct _GPluginPluginInterface {
- void (*state_changed)(GPluginPlugin *plugin, GPluginPluginState oldstate, GPluginPluginState newstate);
+ GPluginPluginState oldstate, + GPluginPluginState newstate); --- a/gplugin/gplugin-private.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-private.c Wed Feb 26 03:13:57 2020 -0600
@@ -19,10 +19,11 @@
/* A GSignalAccumulator that stops emission if a handler returns FALSE */
-gplugin_boolean_accumulator(G_GNUC_UNUSED GSignalInvocationHint *hint,
- const GValue *handler_return,
- G_GNUC_UNUSED gpointer data)
+gplugin_boolean_accumulator( + G_GNUC_UNUSED GSignalInvocationHint *hint, + const GValue *handler_return, + G_GNUC_UNUSED gpointer data) gboolean continue_emission;
gboolean handler_returned;
--- a/gplugin/gplugin-private.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-private.h Wed Feb 26 03:13:57 2020 -0600
@@ -22,18 +22,22 @@
#ifndef GPLUGIN_PRIVATE_H
#define GPLUGIN_PRIVATE_H
+#include <glib-object.h> -#include <glib-object.h>
+#include <gplugin/gplugin-plugin-info.h> #include <gplugin/gplugin-plugin.h>
-#include <gplugin/gplugin-plugin-info.h>
void gplugin_manager_private_init(void);
void gplugin_manager_private_uninit(void);
-gboolean gplugin_boolean_accumulator(GSignalInvocationHint *hint, GValue *return_accu, const GValue *handler_return, gpointer data);
+gboolean gplugin_boolean_accumulator( + GSignalInvocationHint *hint, + const GValue *handler_return, gboolean gplugin_plugin_info_get_bind_local(GPluginPluginInfo *info);
--- a/gplugin/gplugin-query.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-query.c Wed Feb 26 03:13:57 2020 -0600
@@ -36,10 +36,11 @@
*****************************************************************************/
-verbosity_cb(G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
- G_GNUC_UNUSED gpointer d,
- G_GNUC_UNUSED GError **e)
+ G_GNUC_UNUSED const gchar *n, + G_GNUC_UNUSED const gchar *v, + G_GNUC_UNUSED gpointer d, + G_GNUC_UNUSED GError **e) @@ -47,10 +48,11 @@
-full_verbosity_cb(G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
- G_GNUC_UNUSED gpointer d,
- G_GNUC_UNUSED GError **e)
+ G_GNUC_UNUSED const gchar *n, + G_GNUC_UNUSED const gchar *v, + G_GNUC_UNUSED gpointer d, + G_GNUC_UNUSED GError **e) @@ -58,10 +60,11 @@
-internal_cb(G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
- G_GNUC_UNUSED gpointer d,
- G_GNUC_UNUSED GError **e)
+ G_GNUC_UNUSED const gchar *n, + G_GNUC_UNUSED const gchar *v, + G_GNUC_UNUSED gpointer d, + G_GNUC_UNUSED GError **e) @@ -69,10 +72,11 @@
-version_cb(G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
- G_GNUC_UNUSED gpointer d,
- G_GNUC_UNUSED GError **e)
+ G_GNUC_UNUSED const gchar *n, + G_GNUC_UNUSED const gchar *v, + G_GNUC_UNUSED gpointer d, + G_GNUC_UNUSED GError **e) printf("gplugin-query %s\n", GPLUGIN_VERSION);
@@ -82,10 +86,11 @@
-list_cb(G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
- G_GNUC_UNUSED gpointer d,
- G_GNUC_UNUSED GError **e)
+ G_GNUC_UNUSED const gchar *n, + G_GNUC_UNUSED const gchar *v, + G_GNUC_UNUSED gpointer d, + G_GNUC_UNUSED GError **e) @@ -93,14 +98,15 @@
-output_plugin(const gchar *id) {
+output_plugin(const gchar *id) GSList *plugins = NULL, *l = NULL;
gboolean first = TRUE, header_output = FALSE;
- #define MAIN_FORMAT_NEL " " FORMAT ": "
- #define MAIN_FORMAT MAIN_FORMAT_NEL "%s\n"
- #define STR_OR_EMPTY(str) ((str) ? (str) : "")
+#define MAIN_FORMAT_NEL " " FORMAT ": " +#define MAIN_FORMAT MAIN_FORMAT_NEL "%s\n" +#define STR_OR_EMPTY(str) ((str) ? (str) : "") plugins = gplugin_manager_find_plugins(id);
@@ -176,8 +182,10 @@
printf(MAIN_FORMAT, "website", STR_OR_EMPTY(website));
- printf(MAIN_FORMAT, "filename",
- STR_OR_EMPTY(gplugin_plugin_get_filename(plugin)));
+ STR_OR_EMPTY(gplugin_plugin_get_filename(plugin))); GPluginLoader *loader = gplugin_plugin_get_loader(plugin);
@@ -228,7 +236,8 @@
-output_plugins(GList *plugins) {
+output_plugins(GList *plugins) gboolean ret = TRUE, first = TRUE;
@@ -278,7 +287,8 @@
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) GOptionContext *ctx = NULL;
GOptionGroup *group = NULL;
--- a/gplugin/gplugin-version.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/gplugin-version.c Wed Feb 26 03:13:57 2020 -0600
@@ -37,28 +37,28 @@
*****************************************************************************/
-static const gchar *version_pattern = "^(?P<major>\\d+)(\\." \
- "(\\.(?P<micro>\\d+)(?P<extra>.*))?)?$";
+static const gchar *version_pattern = "^(?P<major>\\d+)(\\." + "(\\.(?P<micro>\\d+)(?P<extra>.*))?)?$"; /******************************************************************************
*****************************************************************************/
-gplugin_version_lazy_init(void) {
+gplugin_version_lazy_init(void) static volatile gsize init_volatile = 0;
if(g_once_init_enter(&init_volatile)) {
- regex = g_regex_new(version_pattern, G_REGEX_NO_AUTO_CAPTURE,
+ g_regex_new(version_pattern, G_REGEX_NO_AUTO_CAPTURE, 0, &error); - g_warning(_("Failed to initialize the version regex: %s"),
- (error->message) ? error->message :
+ _("Failed to initialize the version regex: %s"), + (error->message) ? error->message : _("unknown")); @@ -67,8 +67,13 @@
-gplugin_version_parser(const gchar *v, gint *major, gint *minor, gint *micro,
- gchar **extra, GError **error)
gboolean matches = FALSE;
@@ -76,8 +81,12 @@
matches = g_regex_match(regex, v, 0, &info);
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- _("%s does not match the version regex"), v);
+ _("%s does not match the version regex"), @@ -181,7 +190,8 @@
* is owned by GPlugin and must not be modified or freed.
-gplugin_version_check(guint major, guint minor, guint micro) {
+gplugin_version_check(guint major, guint minor, guint micro) if(major > GPLUGIN_MAJOR_VERSION) {
return "gplugin version too old (major mismatch)";
@@ -215,7 +225,8 @@
* greater than 0 if @v1 is greater than @v2.
-gplugin_version_compare(const gchar *v1, const gchar *v2, GError **error) {
+gplugin_version_compare(const gchar *v1, const gchar *v2, GError **error) gint v1_maj = 0, v1_min = 0, v1_mic = 0;
gint v2_maj = 0, v2_min = 0, v2_mic = 0;
--- a/gplugin/tests/bad-plugins/query-error.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/bad-plugins/query-error.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,26 +15,29 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) g_set_error(error, GPLUGIN_DOMAIN, 0, "expected error");
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/bind-local/bind-local.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/bind-local/bind-local.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/dynamic-type/dynamic-test.h Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/dynamic-type/dynamic-test.h Wed Feb 26 03:13:57 2020 -0600
@@ -19,18 +19,23 @@
-#define DYNAMIC_TYPE_TEST (dynamic_test_get_type())
-#define DYNAMIC_TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), DYNAMIC_TYPE_TEST, DynamicTest))
-#define DYNAMIC_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), DYNAMIC_TYPE_TEST, DynamicTestClass))
-#define DYNAMIC_IS_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), DYNAMIC_TYPE_TEST))
-#define DYNAMIC_IS_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), DYNAMIC_TYPE_TEST))
-#define DYNAMIC_TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), DYNAMIC_TYPE_TEST, DynamicTestClass))
+#define DYNAMIC_TYPE_TEST (dynamic_test_get_type()) +#define DYNAMIC_TEST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), DYNAMIC_TYPE_TEST, DynamicTest)) +#define DYNAMIC_TEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), DYNAMIC_TYPE_TEST, DynamicTestClass)) +#define DYNAMIC_IS_TEST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), DYNAMIC_TYPE_TEST)) +#define DYNAMIC_IS_TEST_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), DYNAMIC_TYPE_TEST)) +#define DYNAMIC_TEST_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), DYNAMIC_TYPE_TEST, DynamicTestClass)) -typedef struct _DynamicTest DynamicTest;
-typedef struct _DynamicTestClass DynamicTestClass;
+typedef struct _DynamicTest DynamicTest; +typedef struct _DynamicTestClass DynamicTestClass; +#include <glib-object.h> -#include <glib-object.h>
--- a/gplugin/tests/dynamic-type/dynamic-type-provider.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/dynamic-type/dynamic-type-provider.c Wed Feb 26 03:13:57 2020 -0600
@@ -16,46 +16,51 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
#include "dynamic-test.h"
G_DEFINE_DYNAMIC_TYPE(DynamicTest, dynamic_test, G_TYPE_OBJECT);
-dynamic_test_init(G_GNUC_UNUSED DynamicTest *inst) {
+dynamic_test_init(G_GNUC_UNUSED DynamicTest *inst) g_message("instance created");
-dynamic_test_class_finalize(G_GNUC_UNUSED DynamicTestClass *klass) {
+dynamic_test_class_finalize(G_GNUC_UNUSED DynamicTestClass *klass) -dynamic_test_class_init(G_GNUC_UNUSED DynamicTestClass *klass) {
+dynamic_test_class_init(G_GNUC_UNUSED DynamicTestClass *klass) g_message("class created");
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
"gplugin/dynamic-type-provider",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
-gplugin_load(GPluginNativePlugin *plugin, G_GNUC_UNUSED GError **error) {
+gplugin_load(GPluginNativePlugin *plugin, G_GNUC_UNUSED GError **error) dynamic_test_register_type(G_TYPE_MODULE(plugin));
-gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/dynamic-type/dynamic-type-user.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/dynamic-type/dynamic-type-user.c Wed Feb 26 03:13:57 2020 -0600
@@ -16,19 +16,17 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
#include "dynamic-test.h"
static DynamicTest *test_object = NULL;
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
- const gchar * const dependencies[] = {
- "gplugin/dynamic-type-provider",
+gplugin_query(G_GNUC_UNUSED GError **error) + const gchar *const dependencies[] = {"gplugin/dynamic-type-provider", NULL}; return gplugin_plugin_info_new(
@@ -40,12 +38,16 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) {
+gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) test_object = g_object_new(DYNAMIC_TYPE_TEST, NULL);
- if (test_object == NULL) {
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- "could not create an instance of DynamicTest");
+ if(test_object == NULL) { + "could not create an instance of DynamicTest"); @@ -60,9 +62,8 @@
g_object_unref(test_object);
- if (DYNAMIC_IS_TEST(weak_test_object)) {
- g_set_error(error, GPLUGIN_DOMAIN, 0,
- "test_object is still valid");
+ if(DYNAMIC_IS_TEST(weak_test_object)) { + g_set_error(error, GPLUGIN_DOMAIN, 0, "test_object is still valid"); --- a/gplugin/tests/id-collision/id-collision1.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/id-collision/id-collision1.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/id-collision/id-collision2.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/id-collision/id-collision2.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/load-on-query-fail/load-on-query-fail.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/load-on-query-fail/load-on-query-fail.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
"gplugin/load-on-query-fail",
@@ -30,7 +31,8 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) {
+gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) g_set_error(error, GPLUGIN_DOMAIN, 0, "called %d times", count++);
@@ -39,8 +41,9 @@
-gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/load-on-query-pass/load-on-query-pass.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/load-on-query-pass/load-on-query-pass.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/plugins/basic-plugin.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/plugins/basic-plugin.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,15 +15,13 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
- const gchar * const authors[] = {
+gplugin_query(G_GNUC_UNUSED GError **error) + const gchar *const authors[] = {"author1", NULL}; return gplugin_plugin_info_new(
@@ -42,15 +40,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/plugins/broken-dependent-plugin.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/plugins/broken-dependent-plugin.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,15 +15,13 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
- const gchar * const dependencies[] = {
- "gplugin/does-not-exist",
+gplugin_query(G_GNUC_UNUSED GError **error) + const gchar *const dependencies[] = {"gplugin/does-not-exist", NULL}; return gplugin_plugin_info_new(
@@ -35,15 +33,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/plugins/dependent-plugin.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/plugins/dependent-plugin.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,16 +15,13 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
- const gchar * const dependencies[] = {
+gplugin_query(G_GNUC_UNUSED GError **error) + const gchar *const dependencies[] = {"dependency1", "dependency2", NULL}; return gplugin_plugin_info_new(
@@ -36,15 +33,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/plugins/load-exception.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/plugins/load-exception.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
"gplugin/native-load-exception",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
@@ -27,15 +28,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/plugins/load-failed.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/plugins/load-failed.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,28 +15,30 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
"gplugin/native-load-failed",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) {
+gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) g_set_error(error, GPLUGIN_DOMAIN, 0, "expected error");
-gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/plugins/unload-failed.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/plugins/unload-failed.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,27 +15,29 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
"gplugin/native-unload-failed",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) {
+gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) g_set_error(error, GPLUGIN_DOMAIN, 0, "expected error");
--- a/gplugin/tests/test-bind-local.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-bind-local.c Wed Feb 26 03:13:57 2020 -0600
@@ -17,8 +17,8 @@
+#include <gplugin-native.h> -#include <gplugin-native.h>
@@ -31,7 +31,8 @@
* now we have to settle to see if it was loaded correctly.
GPluginPlugin *plugin = NULL;
gplugin_manager_remove_paths();
@@ -48,16 +49,15 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
/* test the load on query flag */
- g_test_add_func("/loaders/native/bind-local",
+ g_test_add_func("/loaders/native/bind-local", test_bind_local);
--- a/gplugin/tests/test-core.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-core.c Wed Feb 26 03:13:57 2020 -0600
@@ -23,27 +23,31 @@
*****************************************************************************/
-test_gplugin_init_uninit(void) {
+test_gplugin_init_uninit(void) -test_gplugin_init_init_uninit(void) {
+test_gplugin_init_init_uninit(void) -test_gplugin_init_uninit_with_refresh(void) {
+test_gplugin_init_uninit_with_refresh(void) gplugin_manager_refresh();
-test_gplugin_init_uninit_with_refresh_plugins(void) {
+test_gplugin_init_uninit_with_refresh_plugins(void) gplugin_manager_append_path(TEST_DIR);
gplugin_manager_refresh();
@@ -51,7 +55,8 @@
-test_gplugin_init_uninit_with_double_refresh_plugins(void) {
+test_gplugin_init_uninit_with_double_refresh_plugins(void) gint f_ids = 0, s_ids = 0, f_plugins = 0, s_plugins = 0;
@@ -95,23 +100,24 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
- g_test_add_func("/core/init_uninit",
- test_gplugin_init_uninit);
- g_test_add_func("/core/init_init_uninit",
- test_gplugin_init_init_uninit);
- g_test_add_func("/core/init_uninit_with_refresh",
- test_gplugin_init_uninit_with_refresh);
- g_test_add_func("/core/init_uninit_with_refresh_plugins",
- test_gplugin_init_uninit_with_refresh_plugins);
- g_test_add_func("/core/init_uninit_with_double_refresh_plugins",
- test_gplugin_init_uninit_with_double_refresh_plugins);
+ g_test_add_func("/core/init_uninit", test_gplugin_init_uninit); + g_test_add_func("/core/init_init_uninit", test_gplugin_init_init_uninit); + "/core/init_uninit_with_refresh", + test_gplugin_init_uninit_with_refresh); + "/core/init_uninit_with_refresh_plugins", + test_gplugin_init_uninit_with_refresh_plugins); + "/core/init_uninit_with_double_refresh_plugins", + test_gplugin_init_uninit_with_double_refresh_plugins);
--- a/gplugin/tests/test-dynamic-type.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-dynamic-type.c Wed Feb 26 03:13:57 2020 -0600
@@ -17,8 +17,8 @@
+#include <gplugin-native.h> -#include <gplugin-native.h>
@@ -28,7 +28,8 @@
*****************************************************************************/
-test_dynamic_type(void) {
GPluginPlugin *provider = NULL, *user = NULL;
GPluginPluginState state;
@@ -72,16 +73,15 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
- g_test_add_func("/loaders/native/dynamic-type",
+ g_test_add_func("/loaders/native/dynamic-type", test_dynamic_type);
--- a/gplugin/tests/test-id-collision.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-id-collision.c Wed Feb 26 03:13:57 2020 -0600
@@ -17,8 +17,8 @@
+#include <gplugin-native.h> -#include <gplugin-native.h>
@@ -28,7 +28,8 @@
*****************************************************************************/
-test_id_collision(void) {
gplugin_manager_append_path(TEST_ID_DIR);
@@ -46,15 +47,14 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
- g_test_add_func("/loaders/native/id-collision",
+ g_test_add_func("/loaders/native/id-collision", test_id_collision);
--- a/gplugin/tests/test-load-on-query.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-load-on-query.c Wed Feb 26 03:13:57 2020 -0600
@@ -17,8 +17,8 @@
+#include <gplugin-native.h> -#include <gplugin-native.h>
@@ -27,7 +27,8 @@
*****************************************************************************/
-test_load_on_query(void) {
+test_load_on_query(void) GPluginPlugin *plugin = NULL;
gplugin_manager_remove_paths();
@@ -38,12 +39,15 @@
g_assert_nonnull(plugin);
g_assert_true(GPLUGIN_IS_PLUGIN(plugin));
- g_assert_cmpint(gplugin_plugin_get_state(plugin), ==,
- GPLUGIN_PLUGIN_STATE_LOADED);
+ gplugin_plugin_get_state(plugin), + GPLUGIN_PLUGIN_STATE_LOADED); -test_load_on_query_fail_subprocess(void) {
+test_load_on_query_fail_subprocess(void) /* this test is very simple since we can't get the exact error condition
@@ -60,8 +64,12 @@
-test_load_on_query_fail(void) {
- g_test_trap_subprocess("/loaders/native/load-on-query/fail/subprocess", 0, 0);
+test_load_on_query_fail(void) + g_test_trap_subprocess( + "/loaders/native/load-on-query/fail/subprocess", g_test_trap_assert_stderr("*failed to load*during query*");
@@ -70,20 +78,21 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
/* test the load on query flag */
- g_test_add_func("/loaders/native/load-on-query/pass",
- g_test_add_func("/loaders/native/load-on-query/fail",
- test_load_on_query_fail);
- g_test_add_func("/loaders/native/load-on-query/fail/subprocess",
- test_load_on_query_fail_subprocess);
+ g_test_add_func("/loaders/native/load-on-query/pass", test_load_on_query); + "/loaders/native/load-on-query/fail", + test_load_on_query_fail); + "/loaders/native/load-on-query/fail/subprocess", + test_load_on_query_fail_subprocess);
--- a/gplugin/tests/test-loader-registration.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-loader-registration.c Wed Feb 26 03:13:57 2020 -0600
@@ -28,37 +28,46 @@
*****************************************************************************/
#define TEST_GPLUGIN_TYPE_LOADER (test_gplugin_loader_get_type())
-G_DECLARE_FINAL_TYPE(TestGPluginLoader, test_gplugin_loader, TEST_GPLUGIN, LOADER, GPluginLoader)
struct _TestGPluginLoader {
-test_gplugin_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *loader) {
+test_gplugin_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *loader) -test_gplugin_loader_query(G_GNUC_UNUSED GPluginLoader *loader,
- G_GNUC_UNUSED const gchar *filename,
- G_GNUC_UNUSED GError **error)
+test_gplugin_loader_query( + G_GNUC_UNUSED GPluginLoader *loader, + G_GNUC_UNUSED const gchar *filename, + G_GNUC_UNUSED GError **error) -test_gplugin_loader_load(G_GNUC_UNUSED GPluginLoader *loader,
- G_GNUC_UNUSED GPluginPlugin *plugin,
- G_GNUC_UNUSED GError **error)
+test_gplugin_loader_load( + G_GNUC_UNUSED GPluginLoader *loader, + G_GNUC_UNUSED GPluginPlugin *plugin, + G_GNUC_UNUSED GError **error) -test_gplugin_loader_unload(G_GNUC_UNUSED GPluginLoader *loader,
- G_GNUC_UNUSED GPluginPlugin *plugin,
- G_GNUC_UNUSED GError **error)
+test_gplugin_loader_unload( + G_GNUC_UNUSED GPluginLoader *loader, + G_GNUC_UNUSED GPluginPlugin *plugin, + G_GNUC_UNUSED GError **error) @@ -66,11 +75,13 @@
G_DEFINE_TYPE(TestGPluginLoader, test_gplugin_loader, GPLUGIN_TYPE_LOADER)
-test_gplugin_loader_init(TestGPluginLoader *loader) {
+test_gplugin_loader_init(TestGPluginLoader *loader) -test_gplugin_loader_class_init(TestGPluginLoaderClass *klass) {
+test_gplugin_loader_class_init(TestGPluginLoaderClass *klass) GPluginLoaderClass *loader_class = GPLUGIN_LOADER_CLASS(klass);
loader_class->supported_extensions =
@@ -84,7 +95,8 @@
*****************************************************************************/
-test_gplugin_manager_loader_register(void) {
+test_gplugin_manager_loader_register(void) @@ -98,7 +110,8 @@
-test_gplugin_manager_loader_register_twice(void) {
+test_gplugin_manager_loader_register_twice(void) @@ -115,7 +128,8 @@
-test_gplugin_manager_loader_unregister(void) {
+test_gplugin_manager_loader_unregister(void) @@ -134,7 +148,8 @@
-test_gplugin_manager_loader_unregister_twice(void) {
+test_gplugin_manager_loader_unregister_twice(void) @@ -158,22 +173,26 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
- g_test_add_func("/manager/loader/register",
- test_gplugin_manager_loader_register);
- g_test_add_func("/manager/loader/register-twice",
- test_gplugin_manager_loader_register_twice);
+ "/manager/loader/register", + test_gplugin_manager_loader_register); + "/manager/loader/register-twice", + test_gplugin_manager_loader_register_twice); - g_test_add_func("/manager/loader/unregister",
- test_gplugin_manager_loader_unregister);
- g_test_add_func("/manager/loader/unregister-twice",
- test_gplugin_manager_loader_unregister_twice);
+ "/manager/loader/unregister", + test_gplugin_manager_loader_unregister); + "/manager/loader/unregister-twice", + test_gplugin_manager_loader_unregister_twice);
--- a/gplugin/tests/test-native-loader.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-native-loader.c Wed Feb 26 03:13:57 2020 -0600
@@ -17,8 +17,8 @@
+#include <gplugin-native.h> -#include <gplugin-native.h>
@@ -28,7 +28,8 @@
*****************************************************************************/
-test_broken_depend_plugin_load(void) {
+test_broken_depend_plugin_load(void) GPluginPlugin *plugin = NULL;
GPluginPluginState state;
@@ -55,7 +56,8 @@
*****************************************************************************/
-test_query_error_subprocess(void) {
+test_query_error_subprocess(void) GPluginPlugin *plugin = NULL;
/* add the test directory to the plugin manager's search paths */
@@ -70,7 +72,8 @@
-test_query_error(void) {
g_test_trap_subprocess("/loaders/native/error/query/subprocess", 0, 0);
g_test_trap_assert_failed();
@@ -80,7 +83,8 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
@@ -88,15 +92,15 @@
gplugin_loader_tests_main(NULL, TEST_DIR, "native");
- g_test_add_func("/loaders/native/load/broken_dependent",
- test_broken_depend_plugin_load);
+ "/loaders/native/load/broken_dependent", + test_broken_depend_plugin_load); - g_test_add_func("/loaders/native/error/query",
- g_test_add_func("/loaders/native/error/query/subprocess",
- test_query_error_subprocess);
+ g_test_add_func("/loaders/native/error/query", test_query_error); + "/loaders/native/error/query/subprocess", + test_query_error_subprocess);
--- a/gplugin/tests/test-option-group.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-option-group.c Wed Feb 26 03:13:57 2020 -0600
@@ -23,7 +23,8 @@
*****************************************************************************/
-test_gplugin_option_group_paths(const gchar *args, GList *expected) {
+test_gplugin_option_group_paths(const gchar *args, GList *expected) GOptionContext *ctx = NULL;
GOptionGroup *group = NULL;
@@ -63,7 +64,8 @@
-test_gplugin_manager_default_paths(void) {
+test_gplugin_manager_default_paths(void) @@ -77,7 +79,8 @@
-test_gplugin_option_group_default_paths(void) {
+test_gplugin_option_group_default_paths(void) gchar *args = "test-option-group";
@@ -87,7 +90,8 @@
-test_gplugin_option_group_default_paths_with_single(void) {
+test_gplugin_option_group_default_paths_with_single(void) gchar *args = "test-option-group,-p,foo";
@@ -98,7 +102,8 @@
-test_gplugin_option_group_default_paths_with_multiple(void) {
+test_gplugin_option_group_default_paths_with_multiple(void) gchar *args = "test-option-group,-p,foo,-p,bar,-p,baz";
@@ -111,21 +116,24 @@
-test_gplugin_option_group_no_default_paths_short(void) {
+test_gplugin_option_group_no_default_paths_short(void) gchar *args = "test-option-group,-D";
test_gplugin_option_group_paths(args, NULL);
-test_gplugin_option_group_no_default_paths_long(void) {
+test_gplugin_option_group_no_default_paths_long(void) gchar *args = "test-option-group,--no-default-paths";
test_gplugin_option_group_paths(args, NULL);
-test_gplugin_option_group_no_default_paths_with_single(void) {
+test_gplugin_option_group_no_default_paths_with_single(void) gchar *args = "test-option-group,-D,-p,foo";
@@ -135,7 +143,8 @@
-test_gplugin_option_group_no_default_paths_with_multiple(void) {
+test_gplugin_option_group_no_default_paths_with_multiple(void) gchar *args = "test-option-group,-D,-p,foo,-p,bar,-p,baz";
@@ -147,7 +156,8 @@
-test_gplugin_option_group_add_path_short(void) {
+test_gplugin_option_group_add_path_short(void) GList *expected = g_list_prepend(NULL, g_strdup("foo"));
gchar *args = "test-option-group,-D,-p,foo";
@@ -155,7 +165,8 @@
-test_gplugin_option_group_add_path_long(void) {
+test_gplugin_option_group_add_path_long(void) GList *expected = g_list_prepend(NULL, g_strdup("foo"));
gchar *args = "test-option-group,-D,--path,foo";
@@ -166,30 +177,39 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
- g_test_add_func("/option-group/default-paths",
- test_gplugin_option_group_default_paths);
- g_test_add_func("/option-group/default-paths/single",
- test_gplugin_option_group_default_paths_with_single);
- g_test_add_func("/option-group/default-paths/multiple",
- test_gplugin_option_group_default_paths_with_multiple);
+ "/option-group/default-paths", + test_gplugin_option_group_default_paths); + "/option-group/default-paths/single", + test_gplugin_option_group_default_paths_with_single); + "/option-group/default-paths/multiple", + test_gplugin_option_group_default_paths_with_multiple); - g_test_add_func("/option-group/no-default-paths/short",
- test_gplugin_option_group_no_default_paths_short);
- g_test_add_func("/option-group/no-default-paths/long",
- test_gplugin_option_group_no_default_paths_long);
- g_test_add_func("/option-group/no-default-paths/single",
- test_gplugin_option_group_no_default_paths_with_single);
- g_test_add_func("/option-group/no-default-paths/multiple",
- test_gplugin_option_group_no_default_paths_with_multiple);
+ "/option-group/no-default-paths/short", + test_gplugin_option_group_no_default_paths_short); + "/option-group/no-default-paths/long", + test_gplugin_option_group_no_default_paths_long); + "/option-group/no-default-paths/single", + test_gplugin_option_group_no_default_paths_with_single); + "/option-group/no-default-paths/multiple", + test_gplugin_option_group_no_default_paths_with_multiple); - g_test_add_func("/option-group/add-path/short",
- test_gplugin_option_group_add_path_short);
- g_test_add_func("/option-group/add-path/long",
- test_gplugin_option_group_add_path_long);
+ "/option-group/add-path/short", + test_gplugin_option_group_add_path_short); + "/option-group/add-path/long", + test_gplugin_option_group_add_path_long);
--- a/gplugin/tests/test-plugin-info.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-plugin-info.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,37 +15,52 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
-#define test_string(var, value) G_STMT_START { \
- g_assert_cmpstr((var), ==, (value)); \
- g_assert_cmpstr((var), ==, gplugin_plugin_info_get_##var(info)); \
+#define test_string(var, value) \ + g_assert_cmpstr((var), ==, (value)); \ + g_assert_cmpstr((var), ==, gplugin_plugin_info_get_##var(info)); \ -#define test_uint(var, value) G_STMT_START { \
- g_assert_cmpuint((var), ==, (value)); \
- g_assert_cmpuint((var), ==, gplugin_plugin_info_get_##var(info)); \
+#define test_uint(var, value) \ + g_assert_cmpuint((var), ==, (value)); \ + g_assert_cmpuint((var), ==, gplugin_plugin_info_get_##var(info)); \ -#define test_true(var) G_STMT_START { \
- g_assert_true((var)); \
- g_assert_true(gplugin_plugin_info_get_##var(info)); \
+#define test_true(var) \ + g_assert_true((var)); \ + g_assert_true(gplugin_plugin_info_get_##var(info)); \ -#define test_false(var) G_STMT_START { \
- g_assert_false((var)); \
- g_assert_false(gplugin_plugin_info_get_##var(info)); \
+#define test_false(var) \ + g_assert_false((var)); \ + g_assert_false(gplugin_plugin_info_get_##var(info)); \ typedef gchar **(*TestStringVFunc)(GPluginPluginInfo *info);
-test_stringv(gchar **got, const gchar * const * const expected,
- TestStringVFunc func, GPluginPluginInfo *info)
+ const gchar *const *const expected, + GPluginPluginInfo *info) @@ -74,7 +89,8 @@
*****************************************************************************/
-test_gplugin_plugin_info_construction(void) {
+test_gplugin_plugin_info_construction(void) GPluginPluginInfo *info = NULL;
gchar *id = NULL, *name = NULL, *version = NULL, *icon_name = NULL;
gchar *license_id = NULL, *license_text = NULL, *license_url = NULL;
@@ -83,8 +99,8 @@
gchar **authors = NULL, **dependencies = NULL;
gboolean internal = FALSE, load_on_query = FALSE;
- const gchar * const r_authors[] = { "author", NULL };
- const gchar * const r_dependencies[] = { "dependency", NULL };
+ const gchar *const r_authors[] = {"author", NULL}; + const gchar *const r_dependencies[] = {"dependency", NULL}; @@ -145,15 +161,22 @@
test_string(summary, "summary");
test_string(description, "description");
test_string(category, "category");
- test_stringv(authors, r_authors,
- (TestStringVFunc)gplugin_plugin_info_get_authors, info);
+ (TestStringVFunc)gplugin_plugin_info_get_authors, test_string(website, "website");
- test_stringv(dependencies, r_dependencies,
- (TestStringVFunc)gplugin_plugin_info_get_dependencies, info);
+ (TestStringVFunc)gplugin_plugin_info_get_dependencies, -test_gplugin_plugin_info_new_empty(void) {
+test_gplugin_plugin_info_new_empty(void) GPluginPluginInfo *info = NULL;
@@ -177,7 +200,8 @@
-test_gplugin_plugin_info_new_full(void) {
+test_gplugin_plugin_info_new_full(void) GPluginPluginInfo *info = NULL;
gchar *id = NULL, *name = NULL, *version = NULL, *icon_name = NULL;
gchar *license_id = NULL, *license_text = NULL, *license_url = NULL;
@@ -186,8 +210,8 @@
gchar **authors = NULL, **dependencies = NULL;
gboolean internal = FALSE, load_on_query = FALSE;
- const gchar * const r_authors[] = { "author", NULL };
- const gchar * const r_dependencies[] = { "dependency", NULL };
+ const gchar *const r_authors[] = {"author", NULL}; + const gchar *const r_dependencies[] = {"dependency", NULL}; info = gplugin_plugin_info_new(
@@ -247,18 +271,25 @@
test_string(summary, "summary");
test_string(description, "description");
test_string(category, "category");
- test_stringv(authors, r_authors,
- (TestStringVFunc)gplugin_plugin_info_get_authors, info);
+ (TestStringVFunc)gplugin_plugin_info_get_authors, test_string(website, "website");
- test_stringv(dependencies, r_dependencies,
- (TestStringVFunc)gplugin_plugin_info_get_dependencies, info);
+ (TestStringVFunc)gplugin_plugin_info_get_dependencies, -test_gplugin_plugin_info_authors_single(void) {
+test_gplugin_plugin_info_authors_single(void) GPluginPluginInfo *info = NULL;
- const gchar * const authors[] = { "author", NULL };
- const gchar * const *g_authors = NULL;
+ const gchar *const authors[] = {"author", NULL}; + const gchar *const *g_authors = NULL; @@ -278,10 +309,11 @@
-test_gplugin_plugin_info_authors_multiple(void) {
+test_gplugin_plugin_info_authors_multiple(void) GPluginPluginInfo *info = NULL;
- const gchar * const authors[] = { "author1", "author2", NULL };
- const gchar * const *g_authors = NULL;
+ const gchar *const authors[] = {"author1", "author2", NULL}; + const gchar *const *g_authors = NULL; @@ -300,12 +332,12 @@
g_object_unref(G_OBJECT(info));
-test_gplugin_plugin_info_dependencies_single(void) {
+test_gplugin_plugin_info_dependencies_single(void) GPluginPluginInfo *info = NULL;
- gchar *dependencies[] = { "dependency1", NULL };
- const gchar * const *g_dependencies = NULL;
+ gchar *dependencies[] = {"dependency1", NULL}; + const gchar *const *g_dependencies = NULL; @@ -325,10 +357,11 @@
-test_gplugin_plugin_info_dependencies_multiple(void) {
+test_gplugin_plugin_info_dependencies_multiple(void) GPluginPluginInfo *info = NULL;
- gchar *dependencies[] = { "dependencie1", "dependencie2", NULL };
- const gchar * const *g_dependencies = NULL;
+ gchar *dependencies[] = {"dependencie1", "dependencie2", NULL}; + const gchar *const *g_dependencies = NULL; @@ -351,29 +384,34 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
- g_test_add_func("/plugin-info/construction",
- test_gplugin_plugin_info_construction);
+ "/plugin-info/construction", + test_gplugin_plugin_info_construction); - g_test_add_func("/plugin-info/new/empty",
- test_gplugin_plugin_info_new_empty);
- g_test_add_func("/plugin-info/new/full",
- test_gplugin_plugin_info_new_full);
+ "/plugin-info/new/empty", + test_gplugin_plugin_info_new_empty); + g_test_add_func("/plugin-info/new/full", test_gplugin_plugin_info_new_full); - g_test_add_func("/plugin-info/authors/single",
- test_gplugin_plugin_info_authors_single);
- g_test_add_func("/plugin-info/authors/multiple",
- test_gplugin_plugin_info_authors_multiple);
+ "/plugin-info/authors/single", + test_gplugin_plugin_info_authors_single); + "/plugin-info/authors/multiple", + test_gplugin_plugin_info_authors_multiple); - g_test_add_func("/plugin-info/dependencies/single",
- test_gplugin_plugin_info_dependencies_single);
- g_test_add_func("/plugin-info/dependencies/multiple",
- test_gplugin_plugin_info_dependencies_multiple);
+ "/plugin-info/dependencies/single", + test_gplugin_plugin_info_dependencies_single); + "/plugin-info/dependencies/multiple", + test_gplugin_plugin_info_dependencies_multiple);
--- a/gplugin/tests/test-plugin-manager-paths.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-plugin-manager-paths.c Wed Feb 26 03:13:57 2020 -0600
@@ -19,16 +19,20 @@
-#define test_path_count(e) G_STMT_START { \
- GList *paths = gplugin_manager_get_paths(); \
- g_assert_cmpint(g_list_length(paths), ==, (e)); \
+#define test_path_count(e) \ + GList *paths = gplugin_manager_get_paths(); \ + g_assert_cmpint(g_list_length(paths), ==, (e)); \ /******************************************************************************
*****************************************************************************/
-test_gplugin_manager_paths_single(void) {
+test_gplugin_manager_paths_single(void) gplugin_manager_append_path("foo");
@@ -37,7 +41,8 @@
-test_gplugin_manager_paths_duplicate(void) {
+test_gplugin_manager_paths_duplicate(void) gplugin_manager_append_path("foo");
gplugin_manager_append_path("foo");
@@ -48,7 +53,8 @@
-test_gplugin_manager_paths_multiple_fifo(void) {
+test_gplugin_manager_paths_multiple_fifo(void) gplugin_manager_append_path("foo");
@@ -65,7 +71,8 @@
-test_gplugin_manager_paths_multiple_filo(void) {
+test_gplugin_manager_paths_multiple_filo(void) gplugin_manager_append_path("foo");
@@ -82,7 +89,8 @@
-test_gplugin_manager_add_default_paths(void) {
+test_gplugin_manager_add_default_paths(void) GList *paths = NULL, *l = NULL;
@@ -115,7 +123,8 @@
-test_gplugin_manager_add_app_paths(void) {
+test_gplugin_manager_add_app_paths(void) GList *paths = NULL, *l = NULL;
const gchar *prefix = "/usr/local/";
@@ -153,29 +162,35 @@
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
- g_test_add_func("/plugins/paths/add_remove_single",
- test_gplugin_manager_paths_single);
+ "/plugins/paths/add_remove_single", + test_gplugin_manager_paths_single); - g_test_add_func("/plugins/paths/add_remove_duplicate",
- test_gplugin_manager_paths_duplicate);
+ "/plugins/paths/add_remove_duplicate", + test_gplugin_manager_paths_duplicate); - g_test_add_func("/plugins/paths/add_remove_multiple_fifo",
- test_gplugin_manager_paths_multiple_fifo);
+ "/plugins/paths/add_remove_multiple_fifo", + test_gplugin_manager_paths_multiple_fifo); - g_test_add_func("/plugins/paths/add_remove_multiple_filo",
- test_gplugin_manager_paths_multiple_filo);
+ "/plugins/paths/add_remove_multiple_filo", + test_gplugin_manager_paths_multiple_filo); - g_test_add_func("/plugins/paths/add_default_paths",
- test_gplugin_manager_add_default_paths);
- g_test_add_func("/plugins/paths/add_app_paths",
- test_gplugin_manager_add_app_paths);
+ "/plugins/paths/add_default_paths", + test_gplugin_manager_add_default_paths); + "/plugins/paths/add_app_paths", + test_gplugin_manager_add_app_paths);
--- a/gplugin/tests/test-signals.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-signals.c Wed Feb 26 03:13:57 2020 -0600
@@ -31,10 +31,11 @@
*****************************************************************************/
-test_gplugin_manager_signals_normal_loading(G_GNUC_UNUSED GObject *manager,
- G_GNUC_UNUSED GPluginPlugin *plugin,
- G_GNUC_UNUSED GError **error,
+test_gplugin_manager_signals_normal_loading( + G_GNUC_UNUSED GObject *manager, + G_GNUC_UNUSED GPluginPlugin *plugin, + G_GNUC_UNUSED GError **error, TestGPluginManagerSignalsData *data = (TestGPluginManagerSignalsData *)d;
@@ -44,9 +45,10 @@
-test_gplugin_manager_signals_normal_loaded(G_GNUC_UNUSED GObject *manager,
- G_GNUC_UNUSED GPluginPlugin *plugin,
+test_gplugin_manager_signals_normal_loaded( + G_GNUC_UNUSED GObject *manager, + G_GNUC_UNUSED GPluginPlugin *plugin, TestGPluginManagerSignalsData *data = (TestGPluginManagerSignalsData *)d;
@@ -54,10 +56,11 @@
-test_gplugin_manager_signals_normal_unloading(G_GNUC_UNUSED GObject *manager,
- G_GNUC_UNUSED GPluginPlugin *plugin,
- G_GNUC_UNUSED GError **error,
+test_gplugin_manager_signals_normal_unloading( + G_GNUC_UNUSED GObject *manager, + G_GNUC_UNUSED GPluginPlugin *plugin, + G_GNUC_UNUSED GError **error, TestGPluginManagerSignalsData *data = (TestGPluginManagerSignalsData *)d;
@@ -67,9 +70,10 @@
-test_gplugin_manager_signals_normal_unloaded(G_GNUC_UNUSED GObject *manager,
- G_GNUC_UNUSED GPluginPlugin *plugin,
+test_gplugin_manager_signals_normal_unloaded( + G_GNUC_UNUSED GObject *manager, + G_GNUC_UNUSED GPluginPlugin *plugin, TestGPluginManagerSignalsData *data = (TestGPluginManagerSignalsData *)d;
@@ -77,10 +81,11 @@
-test_gplugin_manager_signals_stop_loading(G_GNUC_UNUSED GObject *manager,
- G_GNUC_UNUSED GPluginPlugin *plugin,
+test_gplugin_manager_signals_stop_loading( + G_GNUC_UNUSED GObject *manager, + G_GNUC_UNUSED GPluginPlugin *plugin, TestGPluginManagerSignalsData *data = (TestGPluginManagerSignalsData *)d;
@@ -92,10 +97,11 @@
-test_gplugin_manager_signals_stop_unloading(G_GNUC_UNUSED GObject *manager,
- G_GNUC_UNUSED GPluginPlugin *plugin,
+test_gplugin_manager_signals_stop_unloading( + G_GNUC_UNUSED GObject *manager, + G_GNUC_UNUSED GPluginPlugin *plugin, TestGPluginManagerSignalsData *data = (TestGPluginManagerSignalsData *)d;
@@ -107,9 +113,10 @@
-test_gplugin_manager_signals_load_failed(G_GNUC_UNUSED GObject *manager,
- G_GNUC_UNUSED GPluginPlugin *plugin,
+test_gplugin_manager_signals_load_failed( + G_GNUC_UNUSED GObject *manager, + G_GNUC_UNUSED GPluginPlugin *plugin, TestGPluginManagerSignalsData *data = (TestGPluginManagerSignalsData *)d;
@@ -120,29 +127,34 @@
*****************************************************************************/
-test_gplugin_manager_signals_normal(void) {
+test_gplugin_manager_signals_normal(void) GPluginPlugin *plugin = NULL;
GObject *manager = gplugin_manager_get_instance();
- TestGPluginManagerSignalsData data = { FALSE, FALSE, FALSE, FALSE, FALSE };
- gulong signals[] = { 0, 0, 0, 0};
+ TestGPluginManagerSignalsData data = {FALSE, FALSE, FALSE, FALSE, FALSE}; + gulong signals[] = {0, 0, 0, 0};
- g_signal_connect(manager, "loading-plugin",
- G_CALLBACK(test_gplugin_manager_signals_normal_loading),
- g_signal_connect(manager, "loaded-plugin",
- G_CALLBACK(test_gplugin_manager_signals_normal_loaded),
- g_signal_connect(manager, "unloading-plugin",
- G_CALLBACK(test_gplugin_manager_signals_normal_unloading),
- g_signal_connect(manager, "unloaded-plugin",
- G_CALLBACK(test_gplugin_manager_signals_normal_unloaded),
+ signals[0] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_normal_loading), + signals[1] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_normal_loaded), + signals[2] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_normal_unloading), + signals[3] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_normal_unloaded), gplugin_manager_append_path(TEST_DIR);
gplugin_manager_refresh();
@@ -165,29 +177,34 @@
-test_gplugin_manager_signals_loading_stopped(void) {
+test_gplugin_manager_signals_loading_stopped(void) GPluginPlugin *plugin = NULL;
GObject *manager = gplugin_manager_get_instance();
- TestGPluginManagerSignalsData data = { FALSE, FALSE, FALSE, FALSE, FALSE };
- gulong signals[] = { 0, 0, 0, 0};
+ TestGPluginManagerSignalsData data = {FALSE, FALSE, FALSE, FALSE, FALSE}; + gulong signals[] = {0, 0, 0, 0};
- g_signal_connect(manager, "loading-plugin",
- G_CALLBACK(test_gplugin_manager_signals_stop_loading),
- g_signal_connect(manager, "loaded-plugin",
- G_CALLBACK(test_gplugin_manager_signals_normal_loaded),
- g_signal_connect(manager, "unloading-plugin",
- G_CALLBACK(test_gplugin_manager_signals_normal_unloading),
- g_signal_connect(manager, "unloaded-plugin",
- G_CALLBACK(test_gplugin_manager_signals_normal_unloaded),
+ signals[0] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_stop_loading), + signals[1] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_normal_loaded), + signals[2] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_normal_unloading), + signals[3] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_normal_unloaded), gplugin_manager_append_path(TEST_DIR);
gplugin_manager_refresh();
@@ -207,29 +224,34 @@
-test_gplugin_manager_signals_unloading_stopped(void) {
+test_gplugin_manager_signals_unloading_stopped(void) GPluginPlugin *plugin = NULL;
GObject *manager = gplugin_manager_get_instance();
- TestGPluginManagerSignalsData data = { FALSE, FALSE, FALSE, FALSE, FALSE };
- gulong signals[] = { 0, 0, 0, 0};
+ TestGPluginManagerSignalsData data = {FALSE, FALSE, FALSE, FALSE, FALSE}; + gulong signals[] = {0, 0, 0, 0};
- g_signal_connect(manager, "loading-plugin",
- G_CALLBACK(test_gplugin_manager_signals_normal_loading),
- g_signal_connect(manager, "loaded-plugin",
- G_CALLBACK(test_gplugin_manager_signals_normal_loaded),
- g_signal_connect(manager, "unloading-plugin",
- G_CALLBACK(test_gplugin_manager_signals_stop_unloading),
- g_signal_connect(manager, "unloaded-plugin",
- G_CALLBACK(test_gplugin_manager_signals_normal_unloaded),
+ signals[0] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_normal_loading), + signals[1] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_normal_loaded), + signals[2] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_stop_unloading), + signals[3] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_normal_unloaded), gplugin_manager_append_path(TEST_DIR);
gplugin_manager_refresh();
@@ -252,21 +274,24 @@
-test_gplugin_manager_signals_load_failure(void) {
+test_gplugin_manager_signals_load_failure(void) GPluginPlugin *plugin = NULL;
GObject *manager = gplugin_manager_get_instance();
- TestGPluginManagerSignalsData data = { FALSE, FALSE, FALSE, FALSE, FALSE };
- gulong signals[] = { 0, 0, 0, 0, 0};
+ TestGPluginManagerSignalsData data = {FALSE, FALSE, FALSE, FALSE, FALSE}; + gulong signals[] = {0, 0, 0, 0, 0};
- g_signal_connect(manager, "loading-plugin",
- G_CALLBACK(test_gplugin_manager_signals_normal_loading),
- g_signal_connect(manager, "load-failed",
- G_CALLBACK(test_gplugin_manager_signals_load_failed),
+ signals[0] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_normal_loading), + signals[1] = g_signal_connect( + G_CALLBACK(test_gplugin_manager_signals_load_failed), gplugin_manager_append_path(TEST_DIR);
gplugin_manager_refresh();
@@ -285,21 +310,25 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
- g_test_add_func("/manager/signals/normal",
- test_gplugin_manager_signals_normal);
- g_test_add_func("/manager/signals/loading-stopped",
- test_gplugin_manager_signals_loading_stopped);
- g_test_add_func("/manager/signals/unloading-stopped",
- test_gplugin_manager_signals_unloading_stopped);
- g_test_add_func("/manager/signals/load-failed",
- test_gplugin_manager_signals_load_failure);
+ "/manager/signals/normal", + test_gplugin_manager_signals_normal); + "/manager/signals/loading-stopped", + test_gplugin_manager_signals_loading_stopped); + "/manager/signals/unloading-stopped", + test_gplugin_manager_signals_unloading_stopped); + "/manager/signals/load-failed", + test_gplugin_manager_signals_load_failure);
--- a/gplugin/tests/test-unresolved-symbol.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-unresolved-symbol.c Wed Feb 26 03:13:57 2020 -0600
@@ -17,8 +17,8 @@
+#include <gplugin-native.h> -#include <gplugin-native.h>
@@ -27,12 +27,12 @@
*****************************************************************************/
-test_unresolved_symbol(void) {
+test_unresolved_symbol(void) - "*some_unresolved_symbol*"
+ "*some_unresolved_symbol*"); gplugin_manager_remove_paths();
gplugin_manager_append_path(PLUGIN_DIR);
@@ -45,16 +45,17 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
/* test the load on query flag */
- g_test_add_func("/loaders/native/unresolved-symbol",
- test_unresolved_symbol);
+ "/loaders/native/unresolved-symbol", + test_unresolved_symbol);
--- a/gplugin/tests/test-version-compare.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-version-compare.c Wed Feb 26 03:13:57 2020 -0600
@@ -22,12 +22,14 @@
*****************************************************************************/
-test_gplugin_version_null__null_subprocess(void) {
+test_gplugin_version_null__null_subprocess(void) gplugin_version_compare(NULL, NULL, NULL);
-test_gplugin_version_null__null(void) {
+test_gplugin_version_null__null(void) g_test_trap_subprocess("/version-compare/null__null/subprocess", 0, 0);
g_test_trap_assert_failed();
@@ -35,12 +37,14 @@
-test_gplugin_version_null__1_2_3_subprocess(void) {
+test_gplugin_version_null__1_2_3_subprocess(void) gplugin_version_compare(NULL, "1.2.3", NULL);
-test_gplugin_version_null__1_2_3(void) {
+test_gplugin_version_null__1_2_3(void) g_test_trap_subprocess("/version-compare/null__1_2_3/subprocess", 0, 0);
g_test_trap_assert_failed();
@@ -48,12 +52,14 @@
-test_gplugin_version_1_2_3__null_subprocess(void) {
+test_gplugin_version_1_2_3__null_subprocess(void) gplugin_version_compare("1.2.3", NULL, NULL);
-test_gplugin_version_1_2_3__null(void) {
+test_gplugin_version_1_2_3__null(void) g_test_trap_subprocess("/version-compare/1_2_3__null/subprocess", 0, 0);
g_test_trap_assert_failed();
@@ -61,7 +67,8 @@
-test_gplugin_version_abc__1_2_3_subprocess(void) {
+test_gplugin_version_abc__1_2_3_subprocess(void) @@ -72,7 +79,8 @@
-test_gplugin_version_abc__1_2_3(void) {
+test_gplugin_version_abc__1_2_3(void) g_test_trap_subprocess("/version-compare/abc__1_2_3/subprocess", 0, 0);
g_test_trap_assert_failed();
@@ -80,7 +88,8 @@
-test_gplugin_version_1_2_3__abc_subprocess(void) {
+test_gplugin_version_1_2_3__abc_subprocess(void) @@ -91,7 +100,8 @@
-test_gplugin_version_1_2_3__abc(void) {
+test_gplugin_version_1_2_3__abc(void) g_test_trap_subprocess("/version-compare/1_2_3__abc/subprocess", 0, 0);
g_test_trap_assert_failed();
@@ -100,75 +110,96 @@
/* major version tests */
-test_gplugin_version_1_0_0__0_0_0(void) {
+test_gplugin_version_1_0_0__0_0_0(void) g_assert_cmpint(gplugin_version_compare("1.0.0", "0.0.0", NULL), >, 0);
-test_gplugin_version_1_0_0__1_0_0(void) {
+test_gplugin_version_1_0_0__1_0_0(void) g_assert_cmpint(gplugin_version_compare("1.0.0", "1.0.0", NULL), ==, 0);
-test_gplugin_version_0_0_0__1_0_0(void) {
+test_gplugin_version_0_0_0__1_0_0(void) g_assert_cmpint(gplugin_version_compare("0.0.0", "1.0.0", NULL), <, 0);
/* minor version tests */
-test_gplugin_version_0_1_0__0_0_0(void) {
+test_gplugin_version_0_1_0__0_0_0(void) g_assert_cmpint(gplugin_version_compare("0.1.0", "0.0.0", NULL), >, 0);
-test_gplugin_version_0_1_0__0_1_0(void) {
+test_gplugin_version_0_1_0__0_1_0(void) g_assert_cmpint(gplugin_version_compare("0.1.0", "0.1.0", NULL), ==, 0);
-test_gplugin_version_0_0_0__0_1_0(void) {
+test_gplugin_version_0_0_0__0_1_0(void) g_assert_cmpint(gplugin_version_compare("0.0.0", "0.1.0", NULL), <, 0);
/* micro version tests */
-test_gplugin_version_0_0_1__0_0_0(void) {
+test_gplugin_version_0_0_1__0_0_0(void) g_assert_cmpint(gplugin_version_compare("0.0.1", "0.0.0", NULL), >, 0);
-test_gplugin_version_0_0_1__0_0_1(void) {
+test_gplugin_version_0_0_1__0_0_1(void) g_assert_cmpint(gplugin_version_compare("0.0.1", "0.0.1", NULL), ==, 0);
-test_gplugin_version_0_0_0__0_0_1(void) {
+test_gplugin_version_0_0_0__0_0_1(void) g_assert_cmpint(gplugin_version_compare("0.0.0", "0.0.1", NULL), <, 0);
-static void test_gplugin_version_1_0__0_1(void) {
+test_gplugin_version_1_0__0_1(void) g_assert_cmpint(gplugin_version_compare("1.0", "0.1", NULL), >, 0);
-static void test_gplugin_version_1_0__1_0(void) {
+test_gplugin_version_1_0__1_0(void) g_assert_cmpint(gplugin_version_compare("1.0", "1.0", NULL), ==, 0);
-static void test_gplugin_version_0_1__1_0(void) {
+test_gplugin_version_0_1__1_0(void) g_assert_cmpint(gplugin_version_compare("0.1", "1.0", NULL), <, 0);
-static void test_gplugin_version_1__0(void) {
+test_gplugin_version_1__0(void) g_assert_cmpint(gplugin_version_compare("1", "0", NULL), >, 0);
-static void test_gplugin_version_1__1(void) {
+test_gplugin_version_1__1(void) g_assert_cmpint(gplugin_version_compare("1", "1", NULL), ==, 0);
-static void test_gplugin_version_0__1(void) {
+test_gplugin_version_0__1(void) g_assert_cmpint(gplugin_version_compare("0", "1", NULL), <, 0);
@@ -176,73 +207,86 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
- g_test_add_func("/version-compare/null__null",
- test_gplugin_version_null__null);
- g_test_add_func("/version-compare/null__1_2_3",
- test_gplugin_version_null__1_2_3);
- g_test_add_func("/version-compare/1_2_3__null",
- test_gplugin_version_1_2_3__null);
- g_test_add_func("/version-compare/abc__1_2_3",
- test_gplugin_version_abc__1_2_3);
- g_test_add_func("/version-compare/1_2_3__abc",
- test_gplugin_version_1_2_3__abc);
- g_test_add_func("/version-compare/null__null/subprocess",
- test_gplugin_version_null__null_subprocess);
- g_test_add_func("/version-compare/null__1_2_3/subprocess",
- test_gplugin_version_null__1_2_3_subprocess);
- g_test_add_func("/version-compare/1_2_3__null/subprocess",
- test_gplugin_version_1_2_3__null_subprocess);
- g_test_add_func("/version-compare/abc__1_2_3/subprocess",
- test_gplugin_version_abc__1_2_3_subprocess);
- g_test_add_func("/version-compare/1_2_3__abc/subprocess",
- test_gplugin_version_1_2_3__abc_subprocess);
+ "/version-compare/null__null", + test_gplugin_version_null__null); + "/version-compare/null__1_2_3", + test_gplugin_version_null__1_2_3); + "/version-compare/1_2_3__null", + test_gplugin_version_1_2_3__null); + "/version-compare/abc__1_2_3", + test_gplugin_version_abc__1_2_3); + "/version-compare/1_2_3__abc", + test_gplugin_version_1_2_3__abc); + "/version-compare/null__null/subprocess", + test_gplugin_version_null__null_subprocess); + "/version-compare/null__1_2_3/subprocess", + test_gplugin_version_null__1_2_3_subprocess); + "/version-compare/1_2_3__null/subprocess", + test_gplugin_version_1_2_3__null_subprocess); + "/version-compare/abc__1_2_3/subprocess", + test_gplugin_version_abc__1_2_3_subprocess); + "/version-compare/1_2_3__abc/subprocess", + test_gplugin_version_1_2_3__abc_subprocess); - g_test_add_func("/version-compare/1_0_0__0_0_0",
- test_gplugin_version_1_0_0__0_0_0);
- g_test_add_func("/version-compare/1_0_0__1_0_0",
- test_gplugin_version_1_0_0__1_0_0);
- g_test_add_func("/version-compare/0_0_0__1_0_0",
- test_gplugin_version_0_0_0__1_0_0);
+ "/version-compare/1_0_0__0_0_0", + test_gplugin_version_1_0_0__0_0_0); + "/version-compare/1_0_0__1_0_0", + test_gplugin_version_1_0_0__1_0_0); + "/version-compare/0_0_0__1_0_0", + test_gplugin_version_0_0_0__1_0_0); - g_test_add_func("/version-compare/0_1_0__0_0_0",
- test_gplugin_version_0_1_0__0_0_0);
- g_test_add_func("/version-compare/0_1_0__0_1_0",
- test_gplugin_version_0_1_0__0_1_0);
- g_test_add_func("/version-compare/0_0_0__0_1_0",
- test_gplugin_version_0_0_0__0_1_0);
+ "/version-compare/0_1_0__0_0_0", + test_gplugin_version_0_1_0__0_0_0); + "/version-compare/0_1_0__0_1_0", + test_gplugin_version_0_1_0__0_1_0); + "/version-compare/0_0_0__0_1_0", + test_gplugin_version_0_0_0__0_1_0); - g_test_add_func("/version-compare/0_0_1__0_0_0",
- test_gplugin_version_0_0_1__0_0_0);
- g_test_add_func("/version-compare/0_0_1__0_0_1",
- test_gplugin_version_0_0_1__0_0_1);
- g_test_add_func("/version-compare/0_0_0__0_0_1",
- test_gplugin_version_0_0_0__0_0_1);
+ "/version-compare/0_0_1__0_0_0", + test_gplugin_version_0_0_1__0_0_0); + "/version-compare/0_0_1__0_0_1", + test_gplugin_version_0_0_1__0_0_1); + "/version-compare/0_0_0__0_0_1", + test_gplugin_version_0_0_0__0_0_1); - g_test_add_func("/version-compare/1_0__0_1",
- test_gplugin_version_1_0__0_1);
- g_test_add_func("/version-compare/1_0__1_0",
- test_gplugin_version_1_0__1_0);
- g_test_add_func("/version-compare/0_1__1_0",
- test_gplugin_version_0_1__1_0);
+ g_test_add_func("/version-compare/1_0__0_1", test_gplugin_version_1_0__0_1); + g_test_add_func("/version-compare/1_0__1_0", test_gplugin_version_1_0__1_0); + g_test_add_func("/version-compare/0_1__1_0", test_gplugin_version_0_1__1_0); - g_test_add_func("/version-compare/1__0",
- test_gplugin_version_1__0);
- g_test_add_func("/version-compare/1__1",
- test_gplugin_version_1__1);
- g_test_add_func("/version-compare/0__1",
- test_gplugin_version_0__1);
+ g_test_add_func("/version-compare/1__0", test_gplugin_version_1__0); + g_test_add_func("/version-compare/1__1", test_gplugin_version_1__1); + g_test_add_func("/version-compare/0__1", test_gplugin_version_0__1);
--- a/gplugin/tests/test-versioned-dependencies.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/test-versioned-dependencies.c Wed Feb 26 03:13:57 2020 -0600
@@ -17,8 +17,8 @@
+#include <gplugin-native.h> -#include <gplugin-native.h>
@@ -26,16 +26,19 @@
*****************************************************************************/
-_test_plugin_load_and_has_dependent(GPluginPlugin *dependent,
- G_GNUC_UNUSED const gchar *id)
+_test_plugin_load_and_has_dependent( + GPluginPlugin *dependent, + G_GNUC_UNUSED const gchar *id) GPluginPlugin *plugin = NULL;
GSList *deps = NULL, *l = NULL;
plugin = gplugin_manager_find_plugin("gplugin/test-no-version");
- g_assert_cmpint(gplugin_plugin_get_state(plugin), ==,
- GPLUGIN_PLUGIN_STATE_LOADED);
+ gplugin_plugin_get_state(plugin), + GPLUGIN_PLUGIN_STATE_LOADED); deps = gplugin_manager_get_plugin_dependencies(plugin, NULL);
@@ -57,7 +60,8 @@
*****************************************************************************/
-test_load_with_dependencies(void) {
+test_load_with_dependencies(void) GPluginPlugin *plugin = NULL;
@@ -72,8 +76,10 @@
gplugin_manager_load_plugin(plugin, &error);
g_assert_no_error(error);
- g_assert_cmpint(gplugin_plugin_get_state(plugin), ==,
- GPLUGIN_PLUGIN_STATE_LOADED);
+ gplugin_plugin_get_state(plugin), + GPLUGIN_PLUGIN_STATE_LOADED); g_object_unref(G_OBJECT(plugin));
/* now make sure each dependent plugin that's available was loaded */
@@ -93,16 +99,17 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
/* test the load on query flag */
- g_test_add_func("/dependent-versions/super-dependent",
- test_load_with_dependencies);
+ "/dependent-versions/super-dependent", + test_load_with_dependencies);
--- a/gplugin/tests/unresolved-symbol/unresolved-symbol.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/unresolved-symbol/unresolved-symbol.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,28 +15,31 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
void some_unresolved_symbol(void);
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) some_unresolved_symbol();
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/versioned-dependencies/bar.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/bar.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/versioned-dependencies/baz.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/baz.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/versioned-dependencies/exact1.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/exact1.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/versioned-dependencies/exact2.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/exact2.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/versioned-dependencies/fez.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/fez.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/versioned-dependencies/greater-equal.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/greater-equal.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
"gplugin/test-greater-equal",
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/versioned-dependencies/greater.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/greater.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/versioned-dependencies/less-equal.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/less-equal.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
"gplugin/test-less-equal",
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/versioned-dependencies/less.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/less.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,11 +15,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
@@ -30,15 +31,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/versioned-dependencies/no-version.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/no-version.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,28 +15,27 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
- return gplugin_plugin_info_new(
- "gplugin/test-no-version",
+gplugin_query(G_GNUC_UNUSED GError **error) + return gplugin_plugin_info_new("gplugin/test-no-version", 0x04030201, NULL); -gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/gplugin/tests/versioned-dependencies/super-dependent.c Tue Feb 25 22:30:11 2020 -0600
+++ b/gplugin/tests/versioned-dependencies/super-dependent.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,12 +15,13 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
- const gchar * const dependencies[] = {
+gplugin_query(G_GNUC_UNUSED GError **error) + const gchar *const dependencies[] = { "gplugin/test-no-version",
"gplugin/test-exact1==1.0",
"gplugin/test-exact2=1.0",
@@ -31,8 +32,7 @@
"gplugin/foo|gplugin/bar",
"gplugin/foo|gplugin/baz>=2.0",
"gplugin/foo|gplugin/fez<1.9",
return gplugin_plugin_info_new(
@@ -45,15 +45,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/lua/gplugin-lua-core.c Tue Feb 25 22:30:11 2020 -0600
+++ b/lua/gplugin-lua-core.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,21 +15,20 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
#include "gplugin-lua-loader.h"
#include "gplugin-lua-plugin.h"
#include <glib/gi18n-lib.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
- const gchar * const authors[] = {
+gplugin_query(G_GNUC_UNUSED GError **error) + const gchar *const authors[] = { "Gary Kramlich <grim@reaperworld.com>",
return gplugin_plugin_info_new(
@@ -51,7 +50,8 @@
-gplugin_load(GPluginNativePlugin *plugin, GError **error) {
+gplugin_load(GPluginNativePlugin *plugin, GError **error) gplugin_lua_loader_register(plugin);
gplugin_lua_plugin_register(plugin);
@@ -59,15 +59,13 @@
-gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
+gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) - _("The Lua loader can not be unloaded")
+ _("The Lua loader can not be unloaded")); --- a/lua/gplugin-lua-loader.c Tue Feb 25 22:30:11 2020 -0600
+++ b/lua/gplugin-lua-loader.c Wed Feb 26 03:13:57 2020 -0600
@@ -21,21 +21,25 @@
#include <glib/gi18n-lib.h>
struct _GPluginLuaLoader {
-G_DEFINE_DYNAMIC_TYPE(GPluginLuaLoader, gplugin_lua_loader, GPLUGIN_TYPE_LOADER);
/******************************************************************************
*****************************************************************************/
-_gplugin_lua_error_to_gerror(lua_State *L, GError **error) {
+_gplugin_lua_error_to_gerror(lua_State *L, GError **error) @@ -47,10 +51,11 @@
-_gplugin_lua_loader_load_unload_plugin(G_GNUC_UNUSED GPluginLoader *loader,
+_gplugin_lua_loader_load_unload_plugin( + G_GNUC_UNUSED GPluginLoader *loader, lua_State *L = gplugin_lua_plugin_get_state(GPLUGIN_LUA_PLUGIN(plugin));
@@ -81,13 +86,16 @@
* GPluginLoaderInterface API
*****************************************************************************/
-gplugin_lua_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *l) {
+gplugin_lua_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *l) return g_slist_append(NULL, "lua");
-gplugin_lua_loader_query(GPluginLoader *loader, const gchar *filename,
+gplugin_lua_loader_query( GPluginPlugin *plugin = NULL;
GPluginPluginInfo *info = NULL;
@@ -111,7 +119,11 @@
lua_getglobal(L, "gplugin_query");
- g_set_error(error, GPLUGIN_DOMAIN, 0, "no gplugin_query function found");
+ "no gplugin_query function found"); @@ -145,35 +157,47 @@
-gplugin_lua_loader_load(GPluginLoader *loader, GPluginPlugin *plugin,
+gplugin_lua_loader_load( - return _gplugin_lua_loader_load_unload_plugin(loader, plugin,
- "gplugin_load", error);
+ return _gplugin_lua_loader_load_unload_plugin( -gplugin_lua_loader_unload(GPluginLoader *loader, GPluginPlugin *plugin,
+gplugin_lua_loader_unload( - return _gplugin_lua_loader_load_unload_plugin(loader, plugin,
+ return _gplugin_lua_loader_load_unload_plugin( /******************************************************************************
*****************************************************************************/
-gplugin_lua_loader_init(G_GNUC_UNUSED GPluginLuaLoader *loader) {
+gplugin_lua_loader_init(G_GNUC_UNUSED GPluginLuaLoader *loader) -gplugin_lua_loader_class_finalize(G_GNUC_UNUSED GPluginLuaLoaderClass *klass) {
+gplugin_lua_loader_class_finalize(G_GNUC_UNUSED GPluginLuaLoaderClass *klass) -gplugin_lua_loader_class_init(GPluginLuaLoaderClass *klass) {
+gplugin_lua_loader_class_init(GPluginLuaLoaderClass *klass) GPluginLoaderClass *loader_class = GPLUGIN_LOADER_CLASS(klass);
loader_class->supported_extensions =
@@ -187,6 +211,7 @@
*****************************************************************************/
-gplugin_lua_loader_register(GPluginNativePlugin *plugin) {
+gplugin_lua_loader_register(GPluginNativePlugin *plugin) gplugin_lua_loader_register_type(G_TYPE_MODULE(plugin));
--- a/lua/gplugin-lua-loader.h Tue Feb 25 22:30:11 2020 -0600
+++ b/lua/gplugin-lua-loader.h Wed Feb 26 03:13:57 2020 -0600
@@ -18,13 +18,18 @@
#ifndef GPLUGIN_LUA_LOADER_H
#define GPLUGIN_LUA_LOADER_H
+#include <gplugin-native.h> -#include <gplugin-native.h>
#define GPLUGIN_LUA_TYPE_LOADER (gplugin_lua_loader_get_type())
-G_DECLARE_FINAL_TYPE(GPluginLuaLoader, gplugin_lua_loader, GPLUGIN_LUA, LOADER, GPluginLoader)
void gplugin_lua_loader_register(GPluginNativePlugin *plugin);
--- a/lua/gplugin-lua-plugin.c Tue Feb 25 22:30:11 2020 -0600
+++ b/lua/gplugin-lua-plugin.c Wed Feb 26 03:13:57 2020 -0600
@@ -46,7 +46,9 @@
-static GParamSpec *properties[N_PROPERTIES] = {NULL,};
+static GParamSpec *properties[N_PROPERTIES] = { /* I hate forward declarations... */
static void gplugin_lua_plugin_iface_init(GPluginPluginInterface *iface);
@@ -56,22 +58,25 @@
- G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_lua_plugin_iface_init)
+ G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_lua_plugin_iface_init)); /******************************************************************************
* GPluginPlugin Implementation
*****************************************************************************/
-gplugin_lua_plugin_iface_init(G_GNUC_UNUSED GPluginPluginInterface *iface) {
+gplugin_lua_plugin_iface_init(G_GNUC_UNUSED GPluginPluginInterface *iface) /******************************************************************************
*****************************************************************************/
-gplugin_lua_plugin_get_property(GObject *obj, guint param_id, GValue *value,
+gplugin_lua_plugin_get_property( GPluginLuaPlugin *plugin = GPLUGIN_LUA_PLUGIN(obj);
@@ -101,8 +106,11 @@
-gplugin_lua_plugin_set_property(GObject *obj, guint param_id,
- const GValue *value, GParamSpec *pspec)
+gplugin_lua_plugin_set_property( GPluginLuaPlugin *plugin = GPLUGIN_LUA_PLUGIN(obj);
@@ -132,7 +140,8 @@
-gplugin_lua_plugin_finalize(GObject *obj) {
+gplugin_lua_plugin_finalize(GObject *obj) GPluginLuaPlugin *plugin = GPLUGIN_LUA_PLUGIN(obj);
g_clear_pointer(&plugin->L, lua_close);
@@ -144,15 +153,18 @@
-gplugin_lua_plugin_init(G_GNUC_UNUSED GPluginLuaPlugin *plugin) {
+gplugin_lua_plugin_init(G_GNUC_UNUSED GPluginLuaPlugin *plugin) -gplugin_lua_plugin_class_finalize(G_GNUC_UNUSED GPluginLuaPluginClass *klass) {
+gplugin_lua_plugin_class_finalize(G_GNUC_UNUSED GPluginLuaPluginClass *klass) -gplugin_lua_plugin_class_init(GPluginLuaPluginClass *klass) {
+gplugin_lua_plugin_class_init(GPluginLuaPluginClass *klass) GObjectClass *obj_class = G_OBJECT_CLASS(klass);
obj_class->get_property = gplugin_lua_plugin_get_property;
@@ -160,10 +172,10 @@
obj_class->finalize = gplugin_lua_plugin_finalize;
properties[PROP_LUA_STATE] = g_param_spec_pointer(
- "lua-state", "lua-state",
"The lua state for the plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
@@ -178,12 +190,14 @@
*****************************************************************************/
-gplugin_lua_plugin_register(GPluginNativePlugin *native) {
+gplugin_lua_plugin_register(GPluginNativePlugin *native) gplugin_lua_plugin_register_type(G_TYPE_MODULE(native));
-gplugin_lua_plugin_get_state(GPluginLuaPlugin *plugin) {
+gplugin_lua_plugin_get_state(GPluginLuaPlugin *plugin) g_return_val_if_fail(GPLUGIN_LUA_IS_PLUGIN(plugin), NULL);
--- a/lua/gplugin-lua-plugin.h Tue Feb 25 22:30:11 2020 -0600
+++ b/lua/gplugin-lua-plugin.h Wed Feb 26 03:13:57 2020 -0600
@@ -18,15 +18,20 @@
#ifndef GPLUGIN_LUA_PLUGIN_H
#define GPLUGIN_LUA_PLUGIN_H
+#include <gplugin-native.h> -#include <gplugin-native.h>
#define GPLUGIN_LUA_TYPE_PLUGIN (gplugin_lua_plugin_get_type())
-G_DECLARE_FINAL_TYPE(GPluginLuaPlugin, gplugin_lua_plugin, GPLUGIN_LUA, PLUGIN, GObject)
void gplugin_lua_plugin_register(GPluginNativePlugin *native);
--- a/lua/gplugin-lua-test-lgi.c Tue Feb 25 22:30:11 2020 -0600
+++ b/lua/gplugin-lua-test-lgi.c Wed Feb 26 03:13:57 2020 -0600
@@ -18,30 +18,36 @@
-_add_require_path(lua_State *L, const char *path) {
+_add_require_path(lua_State *L, const char *path) const char *pkg_path = NULL;
lua_getglobal(L, "package");
- lua_getfield(L, -1, "path"); // get field "path" from table at top of stack (-1)
+ "path"); // get field "path" from table at top of stack (-1) pkg_path = lua_tostring(L, -1); // grab path string from top of stack
memset(buff, 0, sizeof(buff));
snprintf(buff, sizeof(buff), "%s;%s", pkg_path, path);
- lua_pop(L, 1); // pop off the path field
- lua_pushstring(L, buff); // push the new one
- lua_setfield(L, -2, "path"); // set the field "path" in table at -2 with value at top of stack
- lua_pop( L, 1 ); // get rid of package table from top of stack
+ lua_pop(L, 1); // pop off the path field + lua_pushstring(L, buff); // push the new one + lua_setfield(L, -2, "path"); // set the field "path" in table at -2 with + // value at top of stack + lua_pop(L, 1); // get rid of package table from top of stack -main(int argc, char *argv[]) {
+main(int argc, char *argv[]) --- a/lua/tests/test-lua-loader.c Tue Feb 25 22:30:11 2020 -0600
+++ b/lua/tests/test-lua-loader.c Wed Feb 26 03:13:57 2020 -0600
@@ -21,7 +21,8 @@
#include <gplugin/gplugin-loader-tests.h>
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
gplugin_loader_tests_main(LUA_LOADER_DIR, LUA_PLUGIN_DIR, "lua");
--- a/perl/gplugin-perl-core.c Tue Feb 25 22:30:11 2020 -0600
+++ b/perl/gplugin-perl-core.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,8 +15,8 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
#include "gplugin-perl-loader.h"
#include "gplugin-perl-plugin.h"
@@ -25,8 +25,9 @@
#include <glib/gi18n-lib.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(GError **error) {
- const gchar * const authors[] = {
+gplugin_query(GError **error) + const gchar *const authors[] = { "Gary Kramlich <grim@reaperworld.com>",
@@ -51,7 +52,8 @@
-gplugin_load(GPluginNativePlugin *plugin, GError **error) {
+gplugin_load(GPluginNativePlugin *plugin, GError **error) gplugin_perl_plugin_register(plugin);
gplugin_perl_loader_register(plugin);
@@ -59,13 +61,13 @@
-gplugin_unload(GPluginNativePlugin *plugin, GError **error) {
+gplugin_unload(GPluginNativePlugin *plugin, GError **error) - _("The Perl loader can not be unloaded")
+ _("The Perl loader can not be unloaded")); --- a/perl/gplugin-perl-loader.c Tue Feb 25 22:30:11 2020 -0600
+++ b/perl/gplugin-perl-loader.c Wed Feb 26 03:13:57 2020 -0600
@@ -24,25 +24,31 @@
-G_DEFINE_DYNAMIC_TYPE(GPluginPerlLoader, gplugin_perl_loader, GPLUGIN_TYPE_LOADER);
static PerlInterpreter *my_perl = NULL;
/******************************************************************************
*****************************************************************************/
-extern void boot_DynaLoader(pTHX_ CV* cv);
+extern void boot_DynaLoader(pTHX_ CV *cv);
-gplugin_perl_loader_xs_init(pTHX) {
+static void gplugin_perl_loader_xs_init(pTHX) newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, __FILE__);
-gplugin_perl_loader_init_perl(void) {
- gchar *args[] = { "", };
+gplugin_perl_loader_init_perl(void) gchar **argv = (gchar **)args;
@@ -55,7 +61,8 @@
-gplugin_perl_loader_uninit_perl(void) {
+gplugin_perl_loader_uninit_perl(void) PERL_SET_CONTEXT(my_perl);
@@ -63,7 +70,10 @@
static GPluginPluginInfo *
-gplugin_perl_loader_call_gplugin_query(PerlInterpreter *interpreter, GError **error) {
+gplugin_perl_loader_call_gplugin_query( + PerlInterpreter *interpreter, GPluginPluginInfo *info = NULL;
PerlInterpreter *old = NULL;
@@ -85,8 +95,11 @@
- g_set_error_literal(error, GPLUGIN_DOMAIN, 0,
- "gplugin_query did not return a GPluginPluginInfo");
+ "gplugin_query did not return a GPluginPluginInfo"); const gchar *errmsg = SvPVutf8_nolen(ERRSV);
@@ -115,8 +128,10 @@
-gplugin_perl_loader_call_boolean(PerlInterpreter *interpreter,
- const gchar *func, GError **error)
+gplugin_perl_loader_call_boolean( + PerlInterpreter *interpreter, PerlInterpreter *old = NULL;
@@ -138,8 +153,12 @@
- g_set_error(error, GPLUGIN_DOMAIN, 0, "%s did not return a value",
+ "%s did not return a value", @@ -167,19 +186,21 @@
* GPluginLoaderInterface API
*****************************************************************************/
-gplugin_perl_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *l) {
+gplugin_perl_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *l) return g_slist_append(NULL, "pl");
-gplugin_perl_loader_query(GPluginLoader *loader,
+gplugin_perl_loader_query( GPluginPlugin *plugin = NULL;
GPluginPluginInfo *info = NULL;
PerlInterpreter *interpreter = NULL;
- const gchar *args[] = { "", filename };
+ const gchar *args[] = {"", filename}; gchar **argv = (gchar **)args;
@@ -188,7 +209,8 @@
PL_perl_destruct_level = 1;
perl_construct(interpreter);
- ret = perl_parse(interpreter, gplugin_perl_loader_xs_init, argc, argv, NULL);
+ perl_parse(interpreter, gplugin_perl_loader_xs_init, argc, argv, NULL); const gchar *errmsg = "unknown error";
@@ -229,53 +251,61 @@
GPLUGIN_PERL_TYPE_PLUGIN,
- "interpreter", interpreter,
- "loader", g_object_ref(loader),
-gplugin_perl_loader_load(G_GNUC_UNUSED GPluginLoader *loader,
+gplugin_perl_loader_load( + G_GNUC_UNUSED GPluginLoader *loader, GPluginPerlPlugin *pplugin = GPLUGIN_PERL_PLUGIN(plugin);
PerlInterpreter *interpreter = NULL;
interpreter = gplugin_perl_plugin_get_interpreter(pplugin);
- return gplugin_perl_loader_call_boolean(interpreter, "gplugin_load",
+ return gplugin_perl_loader_call_boolean(interpreter, "gplugin_load", error); -gplugin_perl_loader_unload(G_GNUC_UNUSED GPluginLoader *loader,
+gplugin_perl_loader_unload( + G_GNUC_UNUSED GPluginLoader *loader, GPluginPerlPlugin *pplugin = GPLUGIN_PERL_PLUGIN(plugin);
PerlInterpreter *interpreter = NULL;
interpreter = gplugin_perl_plugin_get_interpreter(pplugin);
- return gplugin_perl_loader_call_boolean(interpreter, "gplugin_unload",
+ return gplugin_perl_loader_call_boolean( /******************************************************************************
*****************************************************************************/
-gplugin_perl_loader_init(G_GNUC_UNUSED GPluginPerlLoader *loader) {
+gplugin_perl_loader_init(G_GNUC_UNUSED GPluginPerlLoader *loader) -gplugin_perl_loader_class_init(GPluginPerlLoaderClass *klass) {
+gplugin_perl_loader_class_init(GPluginPerlLoaderClass *klass) GPluginLoaderClass *loader_class = GPLUGIN_LOADER_CLASS(klass);
loader_class->supported_extensions =
@@ -299,6 +329,7 @@
*****************************************************************************/
-gplugin_perl_loader_register(GPluginNativePlugin *plugin) {
+gplugin_perl_loader_register(GPluginNativePlugin *plugin) gplugin_perl_loader_register_type(G_TYPE_MODULE(plugin));
--- a/perl/gplugin-perl-loader.h Tue Feb 25 22:30:11 2020 -0600
+++ b/perl/gplugin-perl-loader.h Wed Feb 26 03:13:57 2020 -0600
@@ -18,13 +18,18 @@
#ifndef GPLUGIN_PERL_LOADER_H
#define GPLUGIN_PERL_LOADER_H
+#include <gplugin-native.h> -#include <gplugin-native.h>
#define GPLUGIN_PERL_TYPE_LOADER (gplugin_perl_loader_get_type())
-G_DECLARE_FINAL_TYPE(GPluginPerlLoader, gplugin_perl_loader, GPLUGIN_PERL, LOADER, GPluginLoader)
void gplugin_perl_loader_register(GPluginNativePlugin *plugin);
--- a/perl/gplugin-perl-plugin.c Tue Feb 25 22:30:11 2020 -0600
+++ b/perl/gplugin-perl-plugin.c Wed Feb 26 03:13:57 2020 -0600
@@ -48,7 +48,9 @@
-static GParamSpec *properties[N_PROPERTIES] = {NULL,};
+static GParamSpec *properties[N_PROPERTIES] = { /* I hate forward declarations... */
static void gplugin_perl_plugin_iface_init(GPluginPluginInterface *iface);
@@ -58,8 +60,7 @@
- G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_perl_plugin_iface_init)
+ G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_perl_plugin_iface_init)); /******************************************************************************
* GPluginPlugin Implementation
@@ -73,15 +74,19 @@
*****************************************************************************/
-gplugin_perl_plugin_get_property(GObject *obj, guint param_id, GValue *value,
+gplugin_perl_plugin_get_property( GPluginPerlPlugin *plugin = GPLUGIN_PERL_PLUGIN(obj);
- g_value_set_pointer(value,
- gplugin_perl_plugin_get_interpreter(plugin));
+ gplugin_perl_plugin_get_interpreter(plugin)); @@ -105,8 +110,11 @@
-gplugin_perl_plugin_set_property(GObject *obj, guint param_id,
- const GValue *value, GParamSpec *pspec)
+gplugin_perl_plugin_set_property( GPluginPerlPlugin *plugin = GPLUGIN_PERL_PLUGIN(obj);
@@ -135,7 +143,8 @@
-gplugin_perl_plugin_finalize(GObject *obj) {
+gplugin_perl_plugin_finalize(GObject *obj) GPluginPerlPlugin *plugin = GPLUGIN_PERL_PLUGIN(obj);
perl_destruct(plugin->interpreter);
@@ -160,7 +169,8 @@
-gplugin_perl_plugin_class_init(GPluginPerlPluginClass *klass) {
+gplugin_perl_plugin_class_init(GPluginPerlPluginClass *klass) GObjectClass *obj_class = G_OBJECT_CLASS(klass);
obj_class->get_property = gplugin_perl_plugin_get_property;
@@ -168,10 +178,10 @@
obj_class->finalize = gplugin_perl_plugin_finalize;
properties[PROP_INTERPRETER] = g_param_spec_pointer(
- "interpreter", "interpreter",
"The PERL interpreter for this plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
@@ -192,7 +202,8 @@
-gplugin_perl_plugin_get_interpreter(GPluginPerlPlugin *plugin) {
+gplugin_perl_plugin_get_interpreter(GPluginPerlPlugin *plugin) g_return_val_if_fail(GPLUGIN_PERL_IS_PLUGIN(plugin), NULL);
return plugin->interpreter;
--- a/perl/gplugin-perl-plugin.h Tue Feb 25 22:30:11 2020 -0600
+++ b/perl/gplugin-perl-plugin.h Wed Feb 26 03:13:57 2020 -0600
@@ -18,8 +18,8 @@
#ifndef GPLUGIN_PERL_PLUGIN_H
#define GPLUGIN_PERL_PLUGIN_H
+#include <gplugin-native.h> -#include <gplugin-native.h>
#define PERL_NO_GET_CONTEXT
@@ -31,7 +31,12 @@
#define GPLUGIN_PERL_TYPE_PLUGIN (gplugin_perl_plugin_get_type())
-G_DECLARE_FINAL_TYPE(GPluginPerlPlugin, gplugin_perl_plugin, GPLUGIN_PERL, PLUGIN, GObject)
void gplugin_perl_plugin_register(GPluginNativePlugin *native);
--- a/perl/tests/test-perl-loader.c Tue Feb 25 22:30:11 2020 -0600
+++ b/perl/tests/test-perl-loader.c Wed Feb 26 03:13:57 2020 -0600
@@ -21,7 +21,8 @@
#include <gplugin/gplugin-loader-tests.h>
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
gplugin_loader_tests_main(PERL_LOADER_DIR, PERL_PLUGIN_DIR, "perl");
--- a/python/gplugin-python3-core.c Tue Feb 25 22:30:11 2020 -0600
+++ b/python/gplugin-python3-core.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,8 +15,8 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
#include <glib/gi18n-lib.h>
@@ -24,11 +24,11 @@
#include "gplugin-python3-plugin.h"
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
- const gchar * const authors[] = {
+gplugin_query(G_GNUC_UNUSED GError **error) + const gchar *const authors[] = { "Gary Kramlich <grim@reaperworld.com>",
return gplugin_plugin_info_new(
@@ -50,8 +50,7 @@
-gplugin_load(GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+gplugin_load(GPluginNativePlugin *plugin, G_GNUC_UNUSED GError **error) gplugin_python3_plugin_register(plugin);
gplugin_python3_loader_register(plugin);
@@ -60,15 +59,13 @@
-gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
+gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) - _("The Python loader can not be unloaded")
+ _("The Python loader can not be unloaded")); --- a/python/gplugin-python3-loader.c Tue Feb 25 22:30:11 2020 -0600
+++ b/python/gplugin-python3-loader.c Wed Feb 26 03:13:57 2020 -0600
@@ -35,20 +35,25 @@
-G_DEFINE_DYNAMIC_TYPE(GPluginPython3Loader, gplugin_python3_loader, GPLUGIN_TYPE_LOADER);
+ gplugin_python3_loader, /******************************************************************************
* GPluginLoader Implementation
*****************************************************************************/
-gplugin_python3_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *l) {
+gplugin_python3_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *l) return g_slist_append(NULL, "py");
-gplugin_python3_loader_query(GPluginLoader *loader,
- G_GNUC_UNUSED GError **error)
+gplugin_python3_loader_query( + G_GNUC_UNUSED GError **error) GPluginPlugin *plugin = NULL;
@@ -98,8 +103,9 @@
query = PyDict_GetItemString(module_dict, "gplugin_query");
- g_warning(_("Failed to find the gplugin_query function in %s"),
+ _("Failed to find the gplugin_query function in %s"), pyg_gil_state_release(state);
@@ -107,9 +113,10 @@
if(!PyCallable_Check(query)) {
- g_warning(_("Found gplugin_query in %s but it is not a "
+ _("Found gplugin_query in %s but it is not a " pyg_gil_state_release(state);
@@ -119,8 +126,9 @@
load = PyDict_GetItemString(module_dict, "gplugin_load");
- g_warning(_("Failed to find the gplugin_load function in %s"),
+ _("Failed to find the gplugin_load function in %s"), pyg_gil_state_release(state);
@@ -128,9 +136,10 @@
if(!PyCallable_Check(load)) {
- g_warning(_("Found gplugin_load in %s but it is not a "
+ _("Found gplugin_load in %s but it is not a " pyg_gil_state_release(state);
@@ -140,8 +149,9 @@
unload = PyDict_GetItemString(module_dict, "gplugin_unload");
- g_warning(_("Failed to find the gplugin_unload function in %s"),
+ _("Failed to find the gplugin_unload function in %s"), pyg_gil_state_release(state);
@@ -149,9 +159,10 @@
if(!PyCallable_Check(unload)) {
- g_warning(_("Found gplugin_unload in %s but it is not a "
+ _("Found gplugin_unload in %s but it is not a " pyg_gil_state_release(state);
@@ -191,9 +202,10 @@
-gplugin_python3_loader_load(G_GNUC_UNUSED GPluginLoader *loader,
+gplugin_python3_loader_load( + G_GNUC_UNUSED GPluginLoader *loader, PyObject *load = NULL, *pyplugin = NULL, *result = NULL;
@@ -205,10 +217,10 @@
result = PyObject_CallFunctionObjArgs(load, pyplugin, NULL);
- if (PyErr_Occurred()) {
*error = gplugin_python3_exception_to_gerror();
@@ -219,17 +231,21 @@
- g_set_error_literal(error, GPLUGIN_DOMAIN, 0,
- _("Failed to load plugin"));
+ _("Failed to load plugin")); -gplugin_python3_loader_unload(G_GNUC_UNUSED GPluginLoader *loader,
+gplugin_python3_loader_unload( + G_GNUC_UNUSED GPluginLoader *loader, PyObject *unload = NULL, *pyplugin = NULL, *result = NULL;
@@ -253,8 +269,11 @@
- g_set_error_literal(error, GPLUGIN_DOMAIN, 0,
- _("Failed to unload plugin"));
+ _("Failed to unload plugin")); @@ -264,7 +283,8 @@
*****************************************************************************/
-gplugin_python3_loader_init_pygobject(void) {
+gplugin_python3_loader_init_pygobject(void) PyObject *type = NULL, *value = NULL, *tb = NULL, *obj = NULL;
@@ -292,7 +312,8 @@
-gplugin_python3_loader_init_gettext(void) {
+gplugin_python3_loader_init_gettext(void) PyObject *module_dict = NULL, *install = NULL;
PyObject *gettext = NULL, *result = NULL;
@@ -313,8 +334,9 @@
-gplugin_python3_loader_init_python(void) {
- wchar_t *argv[] = { NULL, NULL };
+gplugin_python3_loader_init_python(void) + wchar_t *argv[] = {NULL, NULL}; @@ -346,16 +368,19 @@
*****************************************************************************/
-gplugin_python3_loader_init(G_GNUC_UNUSED GPluginPython3Loader *loader) {
-gplugin_python3_loader_class_finalize(G_GNUC_UNUSED GPluginPython3LoaderClass *klass)
+gplugin_python3_loader_init(G_GNUC_UNUSED GPluginPython3Loader *loader) -gplugin_python3_loader_class_init(GPluginPython3LoaderClass *klass) {
+gplugin_python3_loader_class_finalize( + G_GNUC_UNUSED GPluginPython3LoaderClass *klass) +gplugin_python3_loader_class_init(GPluginPython3LoaderClass *klass) GPluginLoaderClass *loader_class = GPLUGIN_LOADER_CLASS(klass);
loader_class->supported_extensions =
@@ -369,7 +394,8 @@
*****************************************************************************/
-gplugin_python3_loader_register(GPluginNativePlugin *native) {
+gplugin_python3_loader_register(GPluginNativePlugin *native) gplugin_python3_loader_register_type(G_TYPE_MODULE(native));
gplugin_python3_loader_init_python();
--- a/python/gplugin-python3-loader.h Tue Feb 25 22:30:11 2020 -0600
+++ b/python/gplugin-python3-loader.h Wed Feb 26 03:13:57 2020 -0600
@@ -18,13 +18,18 @@
#ifndef GPLUGIN_PYTHON3_LOADER_H
#define GPLUGIN_PYTHON3_LOADER_H
+#include <gplugin-native.h> -#include <gplugin-native.h>
#define GPLUGIN_PYTHON3_TYPE_LOADER (gplugin_python3_loader_get_type())
-G_DECLARE_FINAL_TYPE(GPluginPython3Loader, gplugin_python3_loader, GPLUGIN_PYTHON3, LOADER, GPluginLoader)
+ gplugin_python3_loader, void gplugin_python3_loader_register(GPluginNativePlugin *native);
--- a/python/gplugin-python3-plugin.c Tue Feb 25 22:30:11 2020 -0600
+++ b/python/gplugin-python3-plugin.c Wed Feb 26 03:13:57 2020 -0600
@@ -52,7 +52,9 @@
-static GParamSpec *properties[N_PROPERTIES] = {NULL,};
+static GParamSpec *properties[N_PROPERTIES] = { /* I hate forward declarations... */
static void gplugin_python3_plugin_iface_init(GPluginPluginInterface *iface);
@@ -62,22 +64,25 @@
- G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_python3_plugin_iface_init)
+ gplugin_python3_plugin_iface_init)); /******************************************************************************
* GPluginPlugin Implementation
*****************************************************************************/
-gplugin_python3_plugin_iface_init(G_GNUC_UNUSED GPluginPluginInterface *iface) {
+gplugin_python3_plugin_iface_init(G_GNUC_UNUSED GPluginPluginInterface *iface) /******************************************************************************
*****************************************************************************/
-gplugin_python3_plugin_set_module(GPluginPython3Plugin *plugin,
+gplugin_python3_plugin_set_module( + GPluginPython3Plugin *plugin, g_return_if_fail(GPLUGIN_IS_PLUGIN(plugin));
g_return_if_fail(module);
@@ -88,15 +93,17 @@
-gplugin_python3_plugin_get_load_func(GPluginPython3Plugin *plugin) {
+gplugin_python3_plugin_get_load_func(GPluginPython3Plugin *plugin) g_return_val_if_fail(GPLUGIN_PYTHON3_IS_PLUGIN(plugin), NULL);
-gplugin_python3_plugin_set_load_func(GPluginPython3Plugin *plugin,
+gplugin_python3_plugin_set_load_func( + GPluginPython3Plugin *plugin, g_return_if_fail(GPLUGIN_PYTHON3_IS_PLUGIN(plugin));
g_return_if_fail(func != NULL);
@@ -107,15 +114,17 @@
-gplugin_python3_plugin_get_unload_func(GPluginPython3Plugin *plugin) {
+gplugin_python3_plugin_get_unload_func(GPluginPython3Plugin *plugin) g_return_val_if_fail(GPLUGIN_PYTHON3_IS_PLUGIN(plugin), NULL);
-gplugin_python3_plugin_set_unload_func(GPluginPython3Plugin *plugin,
+gplugin_python3_plugin_set_unload_func( + GPluginPython3Plugin *plugin, g_return_if_fail(GPLUGIN_PYTHON3_IS_PLUGIN(plugin));
g_return_if_fail(func != NULL);
@@ -129,8 +138,11 @@
*****************************************************************************/
-gplugin_python3_plugin_get_property(GObject *obj, guint param_id, GValue *value,
+gplugin_python3_plugin_get_property( GPluginPython3Plugin *plugin = GPLUGIN_PYTHON3_PLUGIN(obj);
@@ -139,12 +151,14 @@
g_value_set_pointer(value, plugin->module);
- g_value_set_pointer(value,
- gplugin_python3_plugin_get_load_func(plugin));
+ gplugin_python3_plugin_get_load_func(plugin)); - g_value_set_pointer(value,
- gplugin_python3_plugin_get_unload_func(plugin));
+ gplugin_python3_plugin_get_unload_func(plugin)); @@ -168,23 +182,29 @@
-gplugin_python3_plugin_set_property(GObject *obj, guint param_id,
- const GValue *value, GParamSpec *pspec)
+gplugin_python3_plugin_set_property( GPluginPython3Plugin *plugin = GPLUGIN_PYTHON3_PLUGIN(obj);
- gplugin_python3_plugin_set_module(plugin,
- g_value_get_pointer(value));
+ gplugin_python3_plugin_set_module( + g_value_get_pointer(value)); - gplugin_python3_plugin_set_load_func(plugin,
- g_value_get_pointer(value));
+ gplugin_python3_plugin_set_load_func( + g_value_get_pointer(value)); - gplugin_python3_plugin_set_unload_func(plugin,
- g_value_get_pointer(value));
+ gplugin_python3_plugin_set_unload_func( + g_value_get_pointer(value)); @@ -208,7 +228,8 @@
-gplugin_python3_plugin_finalize(GObject *obj) {
+gplugin_python3_plugin_finalize(GObject *obj) GPluginPython3Plugin *plugin = GPLUGIN_PYTHON3_PLUGIN(obj);
Py_CLEAR(plugin->module);
@@ -223,16 +244,19 @@
-gplugin_python3_plugin_init(G_GNUC_UNUSED GPluginPython3Plugin *plugin) {
-gplugin_python3_plugin_class_finalize(G_GNUC_UNUSED GPluginPython3PluginClass *klass)
+gplugin_python3_plugin_init(G_GNUC_UNUSED GPluginPython3Plugin *plugin) -gplugin_python3_plugin_class_init(GPluginPython3PluginClass *klass) {
+gplugin_python3_plugin_class_finalize( + G_GNUC_UNUSED GPluginPython3PluginClass *klass) +gplugin_python3_plugin_class_init(GPluginPython3PluginClass *klass) GObjectClass *obj_class = G_OBJECT_CLASS(klass);
obj_class->get_property = gplugin_python3_plugin_get_property;
@@ -240,22 +264,22 @@
obj_class->finalize = gplugin_python3_plugin_finalize;
properties[PROP_MODULE] = g_param_spec_pointer(
"The python module object",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); properties[PROP_LOAD_FUNC] = g_param_spec_pointer(
- "load-func", "load-func",
"The python load function",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); properties[PROP_UNLOAD_FUNC] = g_param_spec_pointer(
- "unload-func", "unload-func",
"The python unload function",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
@@ -270,7 +294,7 @@
*****************************************************************************/
-gplugin_python3_plugin_register(GPluginNativePlugin *native) {
+gplugin_python3_plugin_register(GPluginNativePlugin *native) gplugin_python3_plugin_register_type(G_TYPE_MODULE(native));
--- a/python/gplugin-python3-plugin.h Tue Feb 25 22:30:11 2020 -0600
+++ b/python/gplugin-python3-plugin.h Wed Feb 26 03:13:57 2020 -0600
@@ -18,13 +18,18 @@
#ifndef GPLUGIN_PYTHON3_PLUGIN_H
#define GPLUGIN_PYTHON3_PLUGIN_H
+#include <gplugin-native.h> -#include <gplugin-native.h>
#define GPLUGIN_PYTHON3_TYPE_PLUGIN (gplugin_python3_plugin_get_type())
-G_DECLARE_FINAL_TYPE(GPluginPython3Plugin, gplugin_python3_plugin, GPLUGIN_PYTHON3, PLUGIN, GObject)
+ gplugin_python3_plugin, void gplugin_python3_plugin_register(GPluginNativePlugin *native);
--- a/python/gplugin-python3-test-pygobject.c Tue Feb 25 22:30:11 2020 -0600
+++ b/python/gplugin-python3-test-pygobject.c Wed Feb 26 03:13:57 2020 -0600
@@ -24,8 +24,9 @@
-main(gint argc, gchar *argv[]) {
- wchar_t *wargv[] = { NULL, NULL };
+main(gint argc, gchar *argv[]) + wchar_t *wargv[] = {NULL, NULL}; --- a/python/gplugin-python3-utils.c Tue Feb 25 22:30:11 2020 -0600
+++ b/python/gplugin-python3-utils.c Wed Feb 26 03:13:57 2020 -0600
@@ -24,7 +24,8 @@
-gplugin_python3_filename_to_module(const gchar *filename) {
+gplugin_python3_filename_to_module(const gchar *filename) gchar *e = NULL, *r = NULL;
@@ -51,7 +52,8 @@
-gplugin_python3_add_module_path(const gchar *module_path) {
+gplugin_python3_add_module_path(const gchar *module_path) PyObject *sys_path = NULL, *path = NULL;
@@ -70,7 +72,8 @@
-gplugin_python3_exception_to_gerror(void) {
+gplugin_python3_exception_to_gerror(void) PyObject *type = NULL, *value = NULL, *trace = NULL;
PyObject *type_name = NULL, *value_str = NULL, *obj = NULL;
@@ -100,9 +103,12 @@
- error = g_error_new(GPLUGIN_DOMAIN, 0, "%s: %s",
- PyBytes_AsString(type_name),
- PyBytes_AsString(value_str));
+ PyBytes_AsString(type_name), + PyBytes_AsString(value_str)); --- a/python/tests/test-python3-loader.c Tue Feb 25 22:30:11 2020 -0600
+++ b/python/tests/test-python3-loader.c Wed Feb 26 03:13:57 2020 -0600
@@ -24,10 +24,14 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
- gplugin_loader_tests_main(PYTHON3_LOADER_DIR, PYTHON3_PLUGIN_DIR, "python3");
+ gplugin_loader_tests_main( --- a/python/tests/test-python3-utils.c Tue Feb 25 22:30:11 2020 -0600
+++ b/python/tests/test-python3-utils.c Wed Feb 26 03:13:57 2020 -0600
@@ -25,19 +25,25 @@
* filename to module tests
*****************************************************************************/
-test_filename_to_module_NULL_subprocess(void) {
+test_filename_to_module_NULL_subprocess(void) gplugin_python3_filename_to_module(NULL);
-test_filename_to_module_NULL(void) {
- g_test_trap_subprocess("/loaders/python/utils/filename_to_module/NULL/subprocess", 0, 0);
+test_filename_to_module_NULL(void) + g_test_trap_subprocess( + "/loaders/python/utils/filename_to_module/NULL/subprocess", g_test_trap_assert_failed();
-test_filename_to_module_empty(void) {
+test_filename_to_module_empty(void) gchar *module = gplugin_python3_filename_to_module("");
g_assert_cmpstr(module, ==, "");
@@ -46,7 +52,8 @@
-test_filename_to_module_no_extension(void) {
+test_filename_to_module_no_extension(void) gchar *module = gplugin_python3_filename_to_module("foo");
g_assert_cmpstr(module, ==, "foo");
@@ -58,18 +65,23 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
- g_test_add_func("/loaders/python/utils/filename_to_module/NULL",
- test_filename_to_module_NULL);
- g_test_add_func("/loaders/python/utils/filename_to_module/NULL/subprocess",
- test_filename_to_module_NULL_subprocess);
- g_test_add_func("/loaders/python/utils/filename_to_module/empty",
- test_filename_to_module_empty);
- g_test_add_func("/loaders/python/utils/filename_to_module/no-extension",
- test_filename_to_module_no_extension);
+ "/loaders/python/utils/filename_to_module/NULL", + test_filename_to_module_NULL); + "/loaders/python/utils/filename_to_module/NULL/subprocess", + test_filename_to_module_NULL_subprocess); + "/loaders/python/utils/filename_to_module/empty", + test_filename_to_module_empty); + "/loaders/python/utils/filename_to_module/no-extension", + test_filename_to_module_no_extension); --- a/tcc/gplugin-tcc-core.c Tue Feb 25 22:30:11 2020 -0600
+++ b/tcc/gplugin-tcc-core.c Wed Feb 26 03:13:57 2020 -0600
@@ -15,21 +15,18 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
#include <glib/gi18n-lib.h>
#include "gplugin-tcc-loader.h"
#include "gplugin-tcc-plugin.h"
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
- const gchar * const authors[] = {
- "Eion Robb <eion@robbmob.com>",
+gplugin_query(G_GNUC_UNUSED GError **error) + const gchar *const authors[] = {"Eion Robb <eion@robbmob.com>", NULL}; return gplugin_plugin_info_new(
@@ -51,7 +48,8 @@
-gplugin_load(GPluginNativePlugin *plugin, GError **error) {
+gplugin_load(GPluginNativePlugin *plugin, GError **error) gplugin_tcc_loader_register(plugin);
gplugin_tcc_plugin_register(plugin);
@@ -59,15 +57,13 @@
-gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
+gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) - _("The TCC loader can not be unloaded")
+ _("The TCC loader can not be unloaded")); --- a/tcc/gplugin-tcc-loader.c Tue Feb 25 22:30:11 2020 -0600
+++ b/tcc/gplugin-tcc-loader.c Wed Feb 26 03:13:57 2020 -0600
@@ -27,19 +27,25 @@
-G_DEFINE_DYNAMIC_TYPE(GPluginTccLoader, gplugin_tcc_loader, GPLUGIN_TYPE_LOADER);
/******************************************************************************
* GPluginLoaderInterface API
*****************************************************************************/
-gplugin_tcc_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *l) {
+gplugin_tcc_loader_supported_extensions(G_GNUC_UNUSED GPluginLoader *l) return g_list_append(NULL, "c");
-gplugin_tcc_loader_query(GPluginLoader *loader, const gchar *filename,
+gplugin_tcc_loader_query( GPluginPlugin *plugin = NULL;
GPluginPluginInfo *info = NULL;
@@ -54,7 +60,12 @@
tcc_set_output_type(s, TCC_OUTPUT_MEMORY);
if(tcc_add_file(s, filename) == -1) {
- g_set_error(error, GPLUGIN_DOMAIN, 0, "couldn't load file %s", filename);
+ "couldn't load file %s", @@ -63,7 +74,11 @@
/* copy code into memory */
if((memsize = tcc_relocate(s, NULL)) < 0) {
- g_set_error(error, GPLUGIN_DOMAIN, 0, "couldn't work out how much memory is needed");
+ "couldn't work out how much memory is needed"); @@ -71,16 +86,25 @@
memneeded = g_malloc0(memsize);
if(tcc_relocate(s, memneeded) < 0) {
- g_set_error(error, GPLUGIN_DOMAIN, 0, "could not relocate plugin into memory");
+ "could not relocate plugin into memory"); - gplugin_query = (GPluginTccPluginQueryFunc) tcc_get_symbol(s, "gplugin_query");
- if (gplugin_query == NULL) {
- g_set_error(error, GPLUGIN_DOMAIN, 0, "no gplugin_query function found");
+ (GPluginTccPluginQueryFunc)tcc_get_symbol(s, "gplugin_query"); + if(gplugin_query == NULL) { + "no gplugin_query function found"); @@ -109,15 +133,16 @@
-gplugin_tcc_loader_load(G_GNUC_UNUSED GPluginLoader *loader,
+gplugin_tcc_loader_load( + G_GNUC_UNUSED GPluginLoader *loader, GPluginTccPluginLoadFunc gplugin_load = NULL;
TCCState *s = gplugin_tcc_plugin_get_state(GPLUGIN_TCC_PLUGIN(plugin));
- gplugin_load = (GPluginTccPluginLoadFunc) tcc_get_symbol(s, "gplugin_load");
- if (gplugin_load == NULL) {
+ gplugin_load = (GPluginTccPluginLoadFunc)tcc_get_symbol(s, "gplugin_load"); + if(gplugin_load == NULL) { g_set_error(error, GPLUGIN_DOMAIN, 0, "no gplugin_load function found");
@@ -127,16 +152,22 @@
-gplugin_tcc_loader_unload(G_GNUC_UNUSED GPluginLoader *loader,
+gplugin_tcc_loader_unload( + G_GNUC_UNUSED GPluginLoader *loader, GPluginTccPluginLoadFunc gplugin_unload = NULL;
TCCState *s = gplugin_tcc_plugin_get_state(GPLUGIN_TCC_PLUGIN(plugin));
- gplugin_unload = (GPluginTccPluginUnloadFunc) tcc_get_symbol(s, "gplugin_unload");
- if (gplugin_unload == NULL) {
- g_set_error(error, GPLUGIN_DOMAIN, 0, "no gplugin_unload function found");
+ (GPluginTccPluginUnloadFunc)tcc_get_symbol(s, "gplugin_unload"); + if(gplugin_unload == NULL) { + "no gplugin_unload function found"); @@ -148,15 +179,18 @@
*****************************************************************************/
-gplugin_tcc_loader_init(G_GNUC_UNUSED GPluginTccLoader *loader) {
+gplugin_tcc_loader_init(G_GNUC_UNUSED GPluginTccLoader *loader) -gplugin_tcc_loader_class_finalize(G_GNUC_UNUSED GPluginTccLoaderClass *klass) {
+gplugin_tcc_loader_class_finalize(G_GNUC_UNUSED GPluginTccLoaderClass *klass) -gplugin_tcc_loader_class_init(GPluginTccLoaderClass *klass) {
+gplugin_tcc_loader_class_init(GPluginTccLoaderClass *klass) GPluginLoaderClass *loader_class = GPLUGIN_LOADER_CLASS(klass);
loader_class->supported_extensions =
@@ -170,6 +204,7 @@
*****************************************************************************/
-gplugin_tcc_loader_register(GPluginNativePlugin *plugin) {
+gplugin_tcc_loader_register(GPluginNativePlugin *plugin) gplugin_tcc_loader_register_type(G_TYPE_MODULE(plugin));
--- a/tcc/gplugin-tcc-loader.h Tue Feb 25 22:30:11 2020 -0600
+++ b/tcc/gplugin-tcc-loader.h Wed Feb 26 03:13:57 2020 -0600
@@ -17,13 +17,18 @@
#ifndef GPLUGIN_TCC_LOADER_H
#define GPLUGIN_TCC_LOADER_H
+#include <gplugin-native.h> -#include <gplugin-native.h>
#define GPLUGIN_TCC_TYPE_LOADER (gplugin_tcc_loader_get_type())
-G_DECLARE_FINAL_TYPE(GPluginTccLoader, gplugin_tcc_loader, GPLUGIN_TCC, LOADER, GPluginLoader)
void gplugin_tcc_loader_register(GPluginNativePlugin *plugin);
--- a/tcc/gplugin-tcc-plugin.c Tue Feb 25 22:30:11 2020 -0600
+++ b/tcc/gplugin-tcc-plugin.c Wed Feb 26 03:13:57 2020 -0600
@@ -49,7 +49,9 @@
-static GParamSpec *properties[N_PROPERTIES] = {NULL,};
+static GParamSpec *properties[N_PROPERTIES] = { /* I hate forward declarations... */
static void gplugin_tcc_plugin_iface_init(GPluginPluginInterface *iface);
@@ -59,8 +61,7 @@
- G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_tcc_plugin_iface_init)
+ G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_tcc_plugin_iface_init)); /******************************************************************************
* GPluginPlugin Implementation
@@ -74,15 +75,17 @@
*****************************************************************************/
-gplugin_tcc_plugin_get_property(GObject *obj, guint param_id, GValue *value,
+gplugin_tcc_plugin_get_property( GPluginTccPlugin *plugin = GPLUGIN_TCC_PLUGIN(obj);
- g_value_set_pointer(value,
- gplugin_tcc_plugin_get_state(plugin));
+ g_value_set_pointer(value, gplugin_tcc_plugin_get_state(plugin)); @@ -106,8 +109,11 @@
-gplugin_tcc_plugin_set_property(GObject *obj, guint param_id,
- const GValue *value, GParamSpec *pspec)
+gplugin_tcc_plugin_set_property( GPluginTccPlugin *plugin = GPLUGIN_TCC_PLUGIN(obj);
@@ -140,7 +146,8 @@
-gplugin_tcc_plugin_finalize(GObject *obj) {
+gplugin_tcc_plugin_finalize(GObject *obj) GPluginTccPlugin *plugin = GPLUGIN_TCC_PLUGIN(obj);
g_clear_pointer(&plugin->s, tcc_delete);
@@ -154,15 +161,18 @@
-gplugin_tcc_plugin_init(G_GNUC_UNUSED GPluginTccPlugin *plugin) {
+gplugin_tcc_plugin_init(G_GNUC_UNUSED GPluginTccPlugin *plugin) -gplugin_tcc_plugin_class_finalize(G_GNUC_UNUSED GPluginTccPluginClass *klass) {
+gplugin_tcc_plugin_class_finalize(G_GNUC_UNUSED GPluginTccPluginClass *klass) -gplugin_tcc_plugin_class_init(GPluginTccPluginClass *klass) {
+gplugin_tcc_plugin_class_init(GPluginTccPluginClass *klass) GObjectClass *obj_class = G_OBJECT_CLASS(klass);
obj_class->get_property = gplugin_tcc_plugin_get_property;
@@ -170,16 +180,16 @@
obj_class->finalize = gplugin_tcc_plugin_finalize;
properties[PROP_TCC_STATE] = g_param_spec_pointer(
- "tcc-state", "tcc-state",
"The TCC compilation context for the plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); properties[PROP_MEM] = g_param_spec_pointer(
"The memory allocated for the symbol table for the plugin",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
@@ -194,12 +204,14 @@
*****************************************************************************/
-gplugin_tcc_plugin_register(GPluginNativePlugin *native) {
+gplugin_tcc_plugin_register(GPluginNativePlugin *native) gplugin_tcc_plugin_register_type(G_TYPE_MODULE(native));
-gplugin_tcc_plugin_get_state(GPluginTccPlugin *plugin) {
+gplugin_tcc_plugin_get_state(GPluginTccPlugin *plugin) g_return_val_if_fail(GPLUGIN_TCC_IS_PLUGIN(plugin), NULL);
--- a/tcc/gplugin-tcc-plugin.h Tue Feb 25 22:30:11 2020 -0600
+++ b/tcc/gplugin-tcc-plugin.h Wed Feb 26 03:13:57 2020 -0600
@@ -17,23 +17,30 @@
#ifndef GPLUGIN_TCC_PLUGIN_H
#define GPLUGIN_TCC_PLUGIN_H
+#include <gplugin-native.h> -#include <gplugin-native.h>
#define GPLUGIN_TCC_TYPE_PLUGIN (gplugin_tcc_plugin_get_type())
-G_DECLARE_FINAL_TYPE(GPluginTccPlugin, gplugin_tcc_plugin, GPLUGIN_TCC, PLUGIN, GObject)
void gplugin_tcc_plugin_register(GPluginNativePlugin *native);
TCCState *gplugin_tcc_plugin_get_state(GPluginTccPlugin *plugin);
typedef GPluginPluginInfo *(*GPluginTccPluginQueryFunc)(GError **error);
-typedef gboolean (*GPluginTccPluginLoadFunc)(GPluginNativePlugin *plugin, GError **error);
-typedef gboolean (*GPluginTccPluginUnloadFunc)(GPluginNativePlugin *plugin, GError **error);
+ *GPluginTccPluginLoadFunc)(GPluginNativePlugin *plugin, GError **error); + *GPluginTccPluginUnloadFunc)(GPluginNativePlugin *plugin, GError **error); --- a/tcc/tests/plugins/basic-plugin.c Tue Feb 25 22:30:11 2020 -0600
+++ b/tcc/tests/plugins/basic-plugin.c Wed Feb 26 03:13:57 2020 -0600
@@ -14,15 +14,13 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
- const gchar * const authors[] = {
+gplugin_query(G_GNUC_UNUSED GError **error) + const gchar *const authors[] = {"author1", NULL}; return gplugin_plugin_info_new(
@@ -41,15 +39,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/tcc/tests/plugins/dependent.c Tue Feb 25 22:30:11 2020 -0600
+++ b/tcc/tests/plugins/dependent.c Wed Feb 26 03:13:57 2020 -0600
@@ -14,16 +14,13 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
- const gchar * const dependencies[] = {
+gplugin_query(G_GNUC_UNUSED GError **error) + const gchar *const dependencies[] = {"dependency1", "dependency2", NULL}; return gplugin_plugin_info_new(
@@ -35,15 +32,17 @@
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/tcc/tests/plugins/load-exception.c Tue Feb 25 22:30:11 2020 -0600
+++ b/tcc/tests/plugins/load-exception.c Wed Feb 26 03:13:57 2020 -0600
@@ -14,28 +14,30 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
"gplugin/native-load-exception",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/tcc/tests/plugins/load-failed.c Tue Feb 25 22:30:11 2020 -0600
+++ b/tcc/tests/plugins/load-failed.c Wed Feb 26 03:13:57 2020 -0600
@@ -14,28 +14,30 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
"gplugin/native-load-failed",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) {
+gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) g_set_error(error, GPLUGIN_DOMAIN, 0, "expected error");
-gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) --- a/tcc/tests/plugins/unload-failed.c Tue Feb 25 22:30:11 2020 -0600
+++ b/tcc/tests/plugins/unload-failed.c Wed Feb 26 03:13:57 2020 -0600
@@ -14,27 +14,29 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#include <gplugin-native.h> -#include <gplugin-native.h>
G_MODULE_EXPORT GPluginPluginInfo *
-gplugin_query(G_GNUC_UNUSED GError **error) {
+gplugin_query(G_GNUC_UNUSED GError **error) return gplugin_plugin_info_new(
"gplugin/native-unload-failed",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
-gplugin_load(G_GNUC_UNUSED GPluginNativePlugin *plugin,
- G_GNUC_UNUSED GError **error)
+ G_GNUC_UNUSED GPluginNativePlugin *plugin, + G_GNUC_UNUSED GError **error) -gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) {
+gplugin_unload(G_GNUC_UNUSED GPluginNativePlugin *plugin, GError **error) g_set_error(error, GPLUGIN_DOMAIN, 0, "expected error");
--- a/tcc/tests/test-tcc-loader.c Tue Feb 25 22:30:11 2020 -0600
+++ b/tcc/tests/test-tcc-loader.c Wed Feb 26 03:13:57 2020 -0600
@@ -21,7 +21,8 @@
#include <gplugin/gplugin-loader-tests.h>
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
gplugin_loader_tests_main(TCC_LOADER_DIR, TCC_PLUGIN_DIR, "c");
--- a/vala/tests/test-genie-loading.c Tue Feb 25 22:30:11 2020 -0600
+++ b/vala/tests/test-genie-loading.c Wed Feb 26 03:13:57 2020 -0600
@@ -24,7 +24,8 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
gplugin_loader_tests_main(NULL, GENIE_PLUGIN_DIR, "genie");
--- a/vala/tests/test-vala-loading.c Tue Feb 25 22:30:11 2020 -0600
+++ b/vala/tests/test-vala-loading.c Wed Feb 26 03:13:57 2020 -0600
@@ -24,7 +24,8 @@
*****************************************************************************/
-main(gint argc, gchar **argv) {
+main(gint argc, gchar **argv) g_test_init(&argc, &argv, NULL);
gplugin_loader_tests_main(NULL, VALA_PLUGIN_DIR, "vala");