Previous

10.3.1.2. Channnels

{

aa) A "channel" corresponds to one or more physical devices (e.g., a card reader, a card punch or a line printer, or even to a set up in nuclear physics the resuls of which are collected by the computer), or to a filestore maintained by the operating system. A channel is a structured value whose fields are routines returning truth values which determine the available methods of access to a book linked via that channel, Since the methods of access to a book may well depend on the book as well as on the channel (e.g., a certain book may have been trapped so that it may be read, but not written to), most of these properties depend on both the channel and the book. These properties may be examined by use of the environment enquiries provided for files {10.3.1.3.ff }. Two environment enquiries are provided for channels. These are:

· estab possible, which returns true if another file may be "established" {10.3.1.4.cc } on the channel;

· standconv, which may be used to obtain the default "conversion key" {bb}for the channel,

bb) A "conversion key" is a value of the mode specified by conv which is used to convert characters to and from the values as stored in internal form and as stored in "external" form in a book. It is a structured value comprising a row of structures, each of which contains a value in internal form and its corresponding external value. The implementation may provide additional conversion keys in its library-prelude.

cc) Three standard channels are provided, with properties as defined below (e,f,g); the implementation may provide additional channels in its library-prelude. The channel number field is provided in order that different channels with otherwise identical possibilities may be distinguished.}

a)

MODE CHANNEL =
  STRUCT (PROC (REF BOOK) BOOL {?} reset, {?} set, {?} get, {?} put, {?} bin, {?} compress, {?} reidf,
    PROC BOOL {?} estab, PROC POS {?} max pos,
    PROC (REF BOOK) CONV {?} standconv, INT {?} channel number);
b) MODE {?}CONV = STRUCT([1: INT(SKIP)] STRUCT(CHAR internal, external) {F}f);

c) PROC estab possible = (CHANNEL chan)BOOL: estab OF chan;

d) PROC standconv = (CHANNEL chan)PROC(REF BOOK)CONV: standconv OF chan;

e)

CHANNEL stand in channel = © a channel value whose field selected
	by 'get' is a routine which always returns true, and
	whose other fields are some suitable values ©;

f)

CHANNEL stand out channel = © a channel value whose field selected
	by 'put' is a routine which always returns true, and
	whose other fields are some suitable values ©;

g)

CHANNEL stand back channel = © a channel value whose fields selected
	by 'set', 'reset', 'get', 'put' and 'bin' are routines which
	always return true, and whose other fields are some suitable values ©;

 
Next