PREV UP NEXT SCM

6.1.5: Ptob Cells

A ptob is a port object, capable of delivering or accepting characters. See Ports. Unlike the types described so far, new varieties of ptobs can be defined dynamically (see Defining Ptobs). These are the initial ptobs:

ptob: tc16_inport
input port.
ptob: tc16_outport
output port.
ptob: tc16_ioport
input-output port.
ptob: tc16_inpipe
input pipe created by popen().
ptob: tc16_outpipe
output pipe created by popen().
ptob: tc16_strport
String port created by cwos() or cwis().
ptob: tc16_sfport
Software (virtual) port created by mksfpt() (see Soft Ports).
Macro: PORTP x
Macro: OPPORTP x
Macro: OPINPORTP x
Macro: OPOUTPORTP x
Macro: INPORTP x
Macro: OUTPORTP x
Returns non-zero if x is a port, open port, open input-port, open output-port, input-port, or output-port, respectively.
Macro: OPENP x
Macro: CLOSEDP x
Returns non-zero if port x is open or closed, respectively.
Macro: STREAM x
Returns the FILE * stream for port x.

Ports which are particularly well behaved are called fports. Advanced operations like file-position and reopen-file only work for fports.

Macro: FPORTP x
Macro: OPFPORTP x
Macro: OPINFPORTP x
Macro: OPOUTFPORTP x
Returns non-zero if x is a port, open port, open input-port, or open output-port, respectively.