> This would be perfectly ok for me. BTW, since you speak of backward
> compatibility, I assume that people have written other lyx clients (apart
> from servermonitor.c in the lyx sources). I would like very much to see
> the code of some of them so I can improve my code, e.g. when it comes to
> error checking, portability or simply cleanness.
Check the How To Get it page at http://www.lyx.org/getit.html and check out
gBib and tclBibText (or something like that.)
Both of these connect to LyX to insert Bibtex references.
> Otherwise, I could simply conform to what the lyxserver does now, i.e. not
> writing anything in the out pipe if a command that returns no data
> succeeds. In this case, I do not fully understand how to check wheter a
> command returning no data has succeeded or not. The only way I know of is
> using select(2) to watch status changes in .lyxpipe.out, is that right?
> If the status has not changed, than lyx hasn't written anything, therefore
> no error occurred.
You could do a hack: Send a command to LyX that has no ill side-effects, but
returns something (like where the cursor is), and if you get the result
immediately, you know that the previous command succeeded.
Actually, this trick could spare us from modifying the protocol.
Greets,
Asger