[Geany-Devel] Spawn module API

Matthew Brush mbrush at xxxxx
Sun Jun 21 17:39:18 UTC 2015

On 2015-06-21 04:25 AM, Dimitar Zhekov wrote:
> On 21.6.2015 г. 06:12, Matthew Brush wrote:
>> I just noticed that the new spawn code exposes almost every single bit
>> of API possible. Do we really want to do that, or should we limit it
>> only to what is currently needed by any plugins? A quick survey of
>> Geany-Plugins shows no usage of any of this yet.
>> IMO, we shouldn't expose anything which is not needed by plugins,
>> especially if it's not related to the plugin API.
> The API is designed not only to ease/fix the spawn pipe I/O, but as a
> possible replacement for all glib spawn functions - and these may be
> invoked by any plugin. (There is no replacement for g_spawn_close_pid,
> which works fine, and for g_spawn_check_exit_status, because it's 2.34+
> only - instead, the WIF* macros are defined system-independently.)
> Spawn neither requires not uses anything from Geany (except i18n), and
> does not change anything in Geany state, so it's functions are not
> strictly "Geany" - it could be a separate library just as well.

Yeah, it almost should be a "separate" library (at least like TM or 
MIO). Personally I don't like the tendency of Geany's plugin API to be 
getting bloated with stuff that has nothing to do with Geany or plugins, 
but rather general purpose stuff making up for shortcomings in GLib, or 
general-purpose convenience functions. But I think maybe this is a 
conversation for another day.

> In the next plugins (after this release), Scope will require at least
> WIF*, spawn_kill_process, SpawnFlags, SpawnReadFunc,
> spawn_with_callbacks, SpawnWriteData and spawn_write_data.
> It'll be good if 'debugger' uses them as well...

I figured there would be some use in at least Scope. Do you have any 
problem if we make all the API private for now and then as you need it 
in Scope (or any other plugins requesting it) we can export precisely 
what is needed, at that time?

Matthew Brush

More information about the Devel mailing list