LIBSTREAMIO-INMOS(3)

NAME
ks.keystream.sink, ks.keystream.to.scrstream, ks.read.char, ks.read.int, ks.read.int64, ks.read.line, ks.read.real32, ks.read.real64, so.keystream.from.file, so.keystream.from.kbd, so.keystream.from.stdin, so.scrstream.to.ANSI, so.scrstream.to.TVI920, so.scrstream.to.file, so.scrstream.to.stdout, ss.beep, ss.clear.eol, ss.clear.eos, ss.del.line, ss.delete.chl, ss.delete.chr, ss.down, ss.goto.xy, ss.ins.line, ss.insert.char, ss.left, ss.right, ss.scrstream.copy, ss.scrstream.fan.out, ss.scrstream.from.array, ss.scrstream.multiplexor, ss.scrstream.sink, ss.scrstream.to.array, ss.up, ww.write.char, ss.write.endstream, ss.write.hex.int, ss.write.hex.int64, ss.write.int, ss.write.int64, ss.write.nl, ss.write.real32, ss.write.real64, ss.write.string, ss.write.text.line - KRoC INMOS occam toolset stream file library

SYNOPSIS
#INCLUDE "streamio.inc" #USE "streamio.lib" kroc -lstreamio

PROC ks.keystream.sink (CHAN OF KS keys)
PROC ks.keystream.to.scrstream (CHAN OF KS keyboard, CHAN OF SS scrn)
PROC ks.read.char (CHAN OF KS source, INT char)
PROC ks.read.int (CHAN OF KS source, INT number, INT char)
PROC ks.read.int64 (CHAN OF KS source, INT64 number, INT char)
PROC ks.read.line (CHAN OF KS source, INT len, []BYTE line, INT char)
PROC ks.read.real32 (CHAN OF KS source, REAL32 number, INT char)
PROC ks.read.real64 (CHAN OF KS source, REAL64 number, INT char)

PROC so.keystream.from.file (CHAN OF SP fs, ts, CHAN OF KS keys.out, VAL []BYTE filename, BYTE result)
PROC so.keystream.from.kbd (CHAN OF SP fs, ts, CHAN OF KS keys.out, CHAN OF BOOL stopper, VAL INT ticks.per.poll)
PROC so.keystream.from.stdin (CHAN OF SP fs, ts, CHAN OF KS keys.out, BYTE result)
PROC so.scrstream.to.ANSI (CHAN OF SP fs, ts, CHAN OF SS scrn)
PROC so.scrstream.to.TVI920 (CHAN OF SP fs, ts, CHAN OF SS scrn)
PROC so.scrstream.to.file (CHAN OF SP fs, ts, CHAN OF SS scrn, VAL []BYTE filename, BYTE result)
PROC so.scrstream.to.stdout (CHAN OF SP fs, ts, CHAN OF SS scrn, BYTE result)

PROC ss.beep (CHAN OF SS scrn)
PROC ss.clear.eol (CHAN OF SS scrn)
PROC ss.clear.eos (CHAN OF SS scrn)
PROC ss.del.line (CHAN OF SS scrn)
PROC ss.delete.chl (CHAN OF SS scrn)
PROC ss.delete.chr (CHAN OF SS scrn)
PROC ss.down (CHAN OF SS scrn)
PROC ss.goto.xy (CHAN OF SS scrn, VAL INT x, y)
PROC ss.ins.line (CHAN OF SS scrn)
PROC ss.insert.char (CHAN OF SS scrn, VAL BYTE ch)
PROC ss.left (CHAN OF SS scrn)
PROC ss.right (CHAN OF SS scrn)
PROC ss.scrstream.copy (CHAN OF SS scrn.in, scrn.out)
PROC ss.scrstream.fan.out (CHAN OF SS scrn, CHAN OF SS screen.out1, screen.out2)
PROC ss.scrstream.from.array (CHAN OF SS scrn, VAL []BYTE buffer)
PROC ss.scrstream.multiplexor ([]CHAN OF SS screen.in, CHAN OF SS screen.out, CHAN OF INT stopper)
PROC ss.scrstream.sink (CHAN OF SS scrn)
PROC ss.scrstream.to.array (CHAN OF SS scrn, []BYTE buffer)
PROC ss.up (CHAN OF SS scrn)
PROC ss.write.char (CHAN OF SS scrn, VAL BYTE char)
PROC ss.write.endstream (CHAN OF SS scrn)
PROC ss.write.hex.int (CHAN OF SS scrn, VAL INT number, VAL INT field)
PROC ss.write.hex.int64 (CHAN OF SS scrn, VAL INT64 number, VAL INT field)
PROC ss.write.int (CHAN OF SS scrn, VAL INT number, VAL INT field)
PROC ss.write.int64 (CHAN OF SS scrn, VAL INT64 number, VAL INT field)
PROC ss.write.nl (CHAN OF SS scrn)
PROC ss.write.real32 (CHAN OF SS scrn, VAL REAL32 number, VAL INT Ip, VAL INT Dp)
PROC ss.write.real64 (CHAN OF SS scrn, VAL REAL64 number, VAL INT Ip, VAL INT Dp)
PROC ss.write.string (CHAN OF SS scrn, VAL []BYTE str)
PROC ss.write.text.line (CHAN OF SS scrn, VAL []BYTE str)

SUMMARY
The occam toolset library streamio.lib provides a stream file interface between the host and the transputer network.

The functions in this library have three protocols in general.

The first is CHAN OF SP fs, ts which is the protocol to and from the host server and refers to most procedures in hostio.lib.

The second is CHAN OF KS which is the keystream or key stream protocol, providing input from the keyboard.

The third is CHAN OF SS which is the scrstream or screen stream protocol which provides output to the screen.

Error returns from procedures are passed out a variable called result which can take the following values:
spr.ok | The operation was successful
spr.bad.name | Invalid name parameter
spr.bad.packet.size | Some data was larger than the built in buffer
>=spr.operation.failed | Server returned a failure

KEY STREAM PROCEDURES
ks.keystream.sink throws away the key stream (KS) input until a termination.

ks.keystream.to.scrstream converts a key stream (KS) protocol to a screen stream (SS) protocol.

ks.read.char, ks.read.int, ks.read.int64, ks.read.line, ks.read.real32, and ks.read.real64 read data from the keyboard using a key stream (KS) protocol.

SCREEN OUTPUT PROCEDURES
so.keystream.from.file, so.keystream.from.kbd and so.keystream.from.stdin read characters from a file, the keyboard or standard input respectively and convert to the key stream (KS) protocol. Termination for the file and standard input is on end of file but the keyboard handler must be terminated by sending any BOOL along stopper.

so.scrstream.to.ANSI, so.scrstream.to.TVI920, so.scrstream.to.file and so.scrstream.to.stdout convert the screen stream (SS) protocol to output on an ANSI terminal, TVI920 terminal, a file or to standard output respectively.

SCREEN STREAM PROCEDURES
ss.beep outputs a terminal bell/beep.

ss.clear.eol makes the terminal clear to the end of line.

ss.clear.eos makes the terminal clear to end of the screen.

ss.del.line makes the terminal delete the current line.

ss.delete.chl makes the terminal delete the character to the left of the cursor.

ss.delete.chr makes the terminal delete the character to the right of the cursor.

ss.down moves the terminal cursor down.

ss.goto.xy moves the terminal cursor to the given x,y coordinate (from top left).

ss.ins.line makes the terminal insert a new line at the cursor position.

ss.insert.char makes the terminal insert a new character at the cursor position.

ss.left moves the terminal cursor left.

ss.right moves the terminal cursor right.

ss.scrstream.copy copies the output of one screen stream onto another.

ss.scrstream.fan.out copies the output of one screen stream onto two others.

ss.scrstream.from.array provides a screen stream from the given array.

ss.scrstream.multiplexor multiplexes several screen streams onto one until any BOOL is received along stopper.

ss.scrstream.sink throws away the screen stream until a terminate is received.

ss.scrstream.to.array outputs a screen stream to the given array.

ss.up moves the terminal cursor up.

ss.write.char writes a character to the terminal.

ss.write.endstream terminates a screen stream (SS).

ss.write.hex.int, ss.write.hex.int64, ss.write.int, ss.write.int64, ss.write.nl, ss.write.real32, ss.write.real64, ss.write.string and ss.write.text.line write the given data type to a screen stream formatting where necessary and possibly padding with spaces to a given field width or printing Ip integer places and Dp decimal places for REAL32 and REAL64 types. Hex numbers are written prefixed by a '#'. PROCedures ending in .nl write a newline sequence.

SEE ALSO
kroc(1)
INMOS occam 2 toolset user manual - part 2 (occam libraries and appendices) INMOS document number 72 TDS 276 02.

AUTHOR
This document is Copyright (C) 1993 David Beckett, University of Kent at Canterbury. This manual page is maintained by Fred Barnes <frmb@kent.ac.uk>

The library contents are Copyright (C) 1991 INMOS Limited.

NOTES
The streamio library is deprecated in favour of the POSIX flavoured libraries provided with KRoC.