[Geany-Devel] Spawn module API

Dimitar Zhekov dimitar.zhekov at xxxxx
Mon Jun 29 18:14:12 UTC 2015


On 27.6.2015 г. 23:50, Lex Trotman wrote:
> On 28 June 2015 at 05:46, Dimitar Zhekov<dimitar.zhekov at gmail.com>  wrote:
>> On 27.6.2015 г. 04:40, Lex Trotman wrote:
>>
>>> spawn_write_data
>>
>>
>> This one looks "platform independent", but it's actually very easy to create
>> a stdin-write function that blocks under Windows...
>
> Better document it then :)

from spawn.c:853:
"The @a stdin_cb may write to @c channel only once per invocation, only 
if @c G_IO_OUT is set, and only a non-zero number of characters."

Though I haven't tested (or don't remember) whether writing more than 4K 
under Win~1 may block... If that's the case, your stdin_cb will better 
be identical to spawn_write_data.

>>> spawn_get_exit_status_callback
>
> I understood it as a convenient default callback, hardly worth not
> exporting it if everybody is going to define the same one-liner
> themselves.  And I'm sure you will document it so nobody is confused
> :)

and from spawn.c:853:
"Convinience @c GChildWatchFunc callback that copies the child exit 
status into a gint pointed by @a exit_status."

It took me a considerable time to solve a seemingly simple task, so it 
would have been a shame not to document everything. :)

--
E-gards: Jimmy


More information about the Devel mailing list