Implement FLUSH in the output handlers.

This commit is contained in:
Adam Sampson 2008-03-12 14:48:27 +00:00
parent 88af6a29d2
commit d7333e4479
2 changed files with 8 additions and 1 deletions

View File

@ -91,7 +91,11 @@ static void tock_tlp_output (Workspace wptr) {
case 0: {
uint8_t ch;
ChanIn (wptr, in, &ch, sizeof ch);
ExternalCallN (fputc, 2, ch, out);
if (ch == 255) { // FLUSH
fflush (out);
} else {
ExternalCallN (fputc, 2, ch, out);
}
break;
}

View File

@ -1,3 +1,5 @@
#USE "course"
PROC main (CHAN OF BYTE in, out)
BOOL running:
SEQ
@ -13,4 +15,5 @@ PROC main (CHAN OF BYTE in, out)
out ! b - ('a' - 'A')
TRUE
out ! b
out ! FLUSH
: