Anybody know anything about the details of stream buffers? Attached is my work to date on creating a viable pipestream. Compiling the code results in an executable "client" that can be used to interact with LyX. It's still pretty clunky, but you get the idea.
The design: the pipestream buffer, basic_fdbuf is to be found in fdbuf.h. It uses some external class to do the actual opening, closing, reading and writing of the data, here pipecomm_client. The idea is that low level rubbish can be shoved into here, leaving a clean basic_fdbuf. Lars can then have a socket stream simply be writing socketcomm ;-) To compile: modify Makefile.common and config.h to suit. To use: start lyx start client press that "open pipes" button in the bottom left corner. note the "hello" message that appears. input "file-open" and press "submit": My problem: it doesn't work :-( More precisely, I can write once, to open the connection with LyX which then replies with "hello". I can also read this reply. Subsequent writes are not output however. I know that the low level pipecom_client itself works fine (note the #ifdefs in ClientController.[Ch]). The problem lies in fdbuf. (I have commented out xsputn because both DEC and GNU define something sophisticated, so I used that. Makes no difference however if I uncomment it.) Thus the problem lies in overflow() sync() or flush() but my knowledge is obviously too limited. Can anyone help? Angus
pipestream.tar.gz
Description: GNU Zip compressed data