@b4n commented on this pull request.


In src/pluginextension.c:

> +	const PluginExtensionEntry *entry_b = b;
+
+	return entry_b->priority - entry_a->priority;
+}
+
+
+GEANY_API_SYMBOL
+void plugin_extension_register(PluginExtension *extension, const gchar *plugin_name,
+	gint priority, gpointer data)
+{
+	PluginExtensionEntry *entry = g_malloc(sizeof *entry);
+
+	entry->extension = extension;
+	entry->data = data;
+	entry->priority = priority;
+	entry->plugin_name = g_strdup(plugin_name ? plugin_name : "unnamed plugin");

Indeed, good idea. I'd just add a g_return_if_fail(name != NULL) so callers give something that can later be used (it's easier to make the API less strict later on if wanted than the other way around)


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/pull/3849/review/2114316544@github.com>