I played with the stream IOS implementation using the following little
Poke implementation of `strings' (yeah, it is the first Poke filter ever
written, and as you can see it uses the strategy we foresaw at Mont
Soleil):
-----<-------
#!/usr/local/bin/poke -L
!#
/* Printable ASCII characters: 0x20..0x7e */
defvar stdin = open ("<stdin>");
defvar stdout = open ("<stdout>");
defvar offset = 0#B;
try
{
flush (stdin, offset);
defvar b = byte @ stdin : offset;
if (b >= 0x20 && b <= 0x7e)
byte @ stdout : iosize (stdout) = b;
offset = offset + 1#B;
}
until E_eof;
close (stdin);
close (stdout);
------>-------
It works, up to some point:
$ cat /usr/bin/ncal | ./pstrings
poke: ../../libpoke/ios-buffer.h:244: ios_buffer_forget_till: Assertion
`buffer->end_offset >= buffer->begin_offset' failed.
ELF> @m@8@@@@888WW ]] Aborted (core dumped)
This is very exciting :)