--- a/gplugin-query/gplugin-query.c Thu Feb 22 22:18:09 2024 -0600
+++ b/gplugin-query/gplugin-query.c Tue Feb 27 23:10:00 2024 -0600
@@ -1,5 +1,5 @@
- * Copyright (C) 2011-2020 Gary Kramlich <grim@reaperworld.com>
+ * Copyright (C) 2011-2024 Gary Kramlich <grim@reaperworld.com> * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -15,8 +15,6 @@
* License along with this library; if not, see <https://www.gnu.org/licenses/>.
@@ -37,8 +35,8 @@
*****************************************************************************/
- G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
+ G_GNUC_UNUSED const char *n, + G_GNUC_UNUSED const char *v, G_GNUC_UNUSED gpointer d,
G_GNUC_UNUSED GError **e)
@@ -49,8 +47,8 @@
- G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
+ G_GNUC_UNUSED const char *n, + G_GNUC_UNUSED const char *v, G_GNUC_UNUSED gpointer d,
G_GNUC_UNUSED GError **e)
@@ -61,8 +59,8 @@
- G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
+ G_GNUC_UNUSED const char *n, + G_GNUC_UNUSED const char *v, G_GNUC_UNUSED gpointer d,
G_GNUC_UNUSED GError **e)
@@ -73,12 +71,12 @@
- G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
+ G_GNUC_UNUSED const char *n, + G_GNUC_UNUSED const char *v, G_GNUC_UNUSED gpointer d,
G_GNUC_UNUSED GError **e)
- printf("gplugin-query %s\n", GPLUGIN_VERSION);
+ g_print("gplugin-query %s\n", GPLUGIN_VERSION); @@ -87,8 +85,8 @@
- G_GNUC_UNUSED const gchar *n,
- G_GNUC_UNUSED const gchar *v,
+ G_GNUC_UNUSED const char *n, + G_GNUC_UNUSED const char *v, G_GNUC_UNUSED gpointer d,
G_GNUC_UNUSED GError **e)
@@ -98,7 +96,7 @@
-output_plugin(const gchar *id)
+output_plugin(const char *id) GPluginManager *manager = gplugin_manager_get_default();
GSList *plugins = NULL, *l = NULL;
@@ -111,7 +109,7 @@
plugins = gplugin_manager_find_plugins(manager, id);
- printf("%s not found\n", id);
+ g_print("%s not found\n", id); @@ -121,19 +119,20 @@
GPluginPluginInfo *info = gplugin_plugin_get_info(plugin);
gboolean internal, loq, bind_global, unloadable;
- gchar *license_id, *license_text, *license_url;
- gchar *icon_name, *summary, *description, *category, *website;
- gchar **authors, **dependencies;
+ char *license_id, *license_text, *license_url; + char *icon_name, *summary, *description, *category, *website; + char **authors, **dependencies; internal = gplugin_plugin_info_get_internal(info);
- if(!show_internal && internal)
+ if(!show_internal && internal) {
@@ -159,33 +158,36 @@
- printf(MAIN_FORMAT, "name", STR_OR_EMPTY(name));
- printf(MAIN_FORMAT, "category", STR_OR_EMPTY(category));
- printf(MAIN_FORMAT, "version", STR_OR_EMPTY(version));
+ g_print(MAIN_FORMAT, "name", STR_OR_EMPTY(name)); + g_print(MAIN_FORMAT, "category", STR_OR_EMPTY(category)); + g_print(MAIN_FORMAT, "version", STR_OR_EMPTY(version)); - printf(MAIN_FORMAT, "license", STR_OR_EMPTY(license_id));
- printf(MAIN_FORMAT, "license url", STR_OR_EMPTY(license_url));
+ g_print(MAIN_FORMAT, "license", STR_OR_EMPTY(license_id)); + g_print(MAIN_FORMAT, "license url", STR_OR_EMPTY(license_url)); - printf(MAIN_FORMAT, "summary", STR_OR_EMPTY(summary));
+ g_print(MAIN_FORMAT, "summary", STR_OR_EMPTY(summary)); - printf(MAIN_FORMAT_NEL, "authors");
+ g_print(MAIN_FORMAT_NEL, "authors"); for(i = 0; authors[i]; i++) {
- printf("%s\n", STR_OR_EMPTY(authors[i]));
+ g_print("%s\n", STR_OR_EMPTY(authors[i]));
- printf(MAIN_FORMAT, "website", STR_OR_EMPTY(website));
+ g_print(MAIN_FORMAT, "website", STR_OR_EMPTY(website));
STR_OR_EMPTY(gplugin_plugin_get_filename(plugin)));
@@ -193,27 +195,29 @@
GPluginLoader *loader = gplugin_plugin_get_loader(plugin);
- printf(MAIN_FORMAT_NEL "%08x\n", "abi version", abi_version);
- printf(MAIN_FORMAT, "internal", (internal) ? "yes" : "no");
- printf(MAIN_FORMAT, "load on query", (loq) ? "yes" : "no");
- printf(MAIN_FORMAT, "bind globally", (bind_global) ? "yes" : "no");
- printf(MAIN_FORMAT, "unloadable", (unloadable) ? "yes" : "no");
- printf(MAIN_FORMAT, "loader", G_OBJECT_TYPE_NAME(loader));
+ g_print(MAIN_FORMAT_NEL "%08x\n", "abi version", abi_version); + g_print(MAIN_FORMAT, "internal", (internal) ? "yes" : "no"); + g_print(MAIN_FORMAT, "load on query", (loq) ? "yes" : "no"); + g_print(MAIN_FORMAT, "bind globally", (bind_global) ? "yes" : "no"); + g_print(MAIN_FORMAT, "unloadable", (unloadable) ? "yes" : "no"); + g_print(MAIN_FORMAT, "loader", G_OBJECT_TYPE_NAME(loader));
- printf(MAIN_FORMAT, "description", STR_OR_EMPTY(description));
+ g_print(MAIN_FORMAT, "description", STR_OR_EMPTY(description)); - printf(MAIN_FORMAT_NEL, "dependencies");
+ g_print(MAIN_FORMAT_NEL, "dependencies"); for(i = 0; dependencies[i]; i++) {
- printf("%s\n", STR_OR_EMPTY(dependencies[i]));
+ g_print("%s\n", STR_OR_EMPTY(dependencies[i]));
@@ -231,8 +235,9 @@
g_strfreev(dependencies);
g_slist_free_full(plugins, g_object_unref);
@@ -247,14 +252,17 @@
gboolean ret = TRUE, first = TRUE;
for(l = plugins; l; l = l->next) {
- if(!output_plugin(l->data))
+ if(!output_plugin(l->data)) {
@@ -292,7 +300,7 @@
-main(gint argc, gchar **argv)
+main(gint argc, char **argv) GPluginManager *manager = NULL;
@@ -312,7 +320,7 @@
g_option_context_free(ctx);
- fprintf(stderr, "%s\n", error->message);
+ g_printerr("%s\n", error->message); @@ -336,7 +344,7 @@
for(path = gplugin_manager_get_paths(manager); path;
- printf("%s\n", (gchar *)path->data);
+ g_print("%s\n", (char *)path->data); @@ -355,24 +363,28 @@
GQueue *plugins = g_queue_new();
for(i = 1; i < argc; i++) {
- if(strlen(argv[i]) == 0)
+ if(strlen(argv[i]) == 0) { g_queue_push_tail(plugins, argv[i]);
- if(!output_plugins(plugins->head))
+ if(!output_plugins(plugins->head)) { GList *plugins = gplugin_manager_list_plugins(manager);
- if(!output_plugins(plugins))
+ if(!output_plugins(plugins)) {