* Add GEANY_ prefix to enumerators. * Use a discrete set of enumerators so the proxy doesn't have to worry about flag bitmasks, which isn't required. * Update documentation. * Use the new enumerators in Geany. * Improve debug output for bogus values a bit. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1213
-- Commit Summary --
* Improve GeanyProxyProbeResults a litte
-- File Changes --
M doc/plugins.dox (13) M plugins/demoproxy.c (2) M src/plugindata.h (39) M src/plugins.c (13)
-- Patch Links --
https://github.com/geany/geany/pull/1213.patch https://github.com/geany/geany/pull/1213.diff
@@ -379,7 +392,7 @@ GeanyProxyProbeResults; struct GeanyProxyFuncs { /** Called to determine whether the proxy is truly responsible for the requested plugin.
* A NULL pointer assumes the probe() function would always return @ref PROXY_MATCHED */
gint (*probe) (GeanyPlugin *proxy, const gchar *filename, gpointer pdata);* A NULL pointer assumes the probe() function would always return @ref GEANY_PROXY_MATCH */
ideally the function would return `GeanyProxyProbeResults`, but well, it'd technically be an ABI break -- even though we know everyone use 2's complement so it wouldn't change nothing, but meh.
Makes sense. The only advantage of flags over enumeration is to be able to combine them, but here it doesn't seem to really make any sense, and I can't easily think of a future change reusing `NOLOAD` with something else than `MATCH`. And yeah, it's kind of unexpected to not be allowed to return `IGNORE | NOLOAD` yet them being flags.
@@ -379,7 +392,7 @@ GeanyProxyProbeResults; struct GeanyProxyFuncs { /** Called to determine whether the proxy is truly responsible for the requested plugin.
* A NULL pointer assumes the probe() function would always return @ref PROXY_MATCHED */
gint (*probe) (GeanyPlugin *proxy, const gchar *filename, gpointer pdata);* A NULL pointer assumes the probe() function would always return @ref GEANY_PROXY_MATCH */
I find NOLOAD is the better name
Manager and allows other enabled proxy plugins to pick it up. GeanyProxyFuncs::probe() returning -@ref PROXY_IGNORED is an indication that the candidate is meant for another proxy, or the user +@ref GEANY_PROXY_IGNORE is an indication that the candidate is meant for another proxy, or the user
PROXY_IGNORE doesn't exist (was renamed to NOLOAD), can you please fix that also?
Can we find a better name than _RELATED? IMO it doesn't suggest that it wont be loaded.
Can we find a better name than _RELATED? IMO it doesn't suggest that it wont be loaded.
Correct, it suggest that it _may_ be loaded (by the proxy) and is related to a "matched" one, but is not matched itself. It makes sense from the proxy plugin's point of view. If you look at it from Geany's point of view, then NOLOAD makes some kind of sense, but this is the proxy plugin API so it should be from that perspective, IMO.
Manager and allows other enabled proxy plugins to pick it up. GeanyProxyFuncs::probe() returning -@ref PROXY_IGNORED is an indication that the candidate is meant for another proxy, or the user +@ref GEANY_PROXY_IGNORE is an indication that the candidate is meant for another proxy, or the user
What? It's [still in the enum](https://github.com/geany/geany/blob/master/src/plugindata.h#L356) and [documented there](https://github.com/geany/geany/blob/master/src/plugindata.h#L356) and in the [enum doc-comment](https://github.com/geany/geany/blob/master/src/plugindata.h#L344). I don't understand.
Manager and allows other enabled proxy plugins to pick it up. GeanyProxyFuncs::probe() returning -@ref PROXY_IGNORED is an indication that the candidate is meant for another proxy, or the user +@ref GEANY_PROXY_IGNORE is an indication that the candidate is meant for another proxy, or the user
Nevermind, I was confused.
Merged #1213.
Can we find a better name than _RELATED
Can add later as a synonym without break ABI.
github-comments@lists.geany.org