<?xml version='1.0' encoding='ISO-8859-1' standalone='no'?>
<!DOCTYPE interface-description SYSTEM 'file:///usr/pkgsrc/lang/oo2c/work.macaroon/oo2c_32-2.0.11/rsrc/OOC/xml/interface-description.dtd'>
<interface-description name='Channel' id=''>
  <oberon-doc>
    <summary>The module defines the abstract data types <oberon-type href='#Channel'>Channel</oberon-type>, <oberon-type href='#Reader'>Reader</oberon-type>, and <oberon-type href='#Writer'>Writer</oberon-type> for stream I/O.</summary>
    <p pad-after='yes' no-indent='yes'>The module defines the abstract data types <oberon-type href='#Channel'>Channel</oberon-type>, <oberon-type href='#Reader'>Reader</oberon-type>, and <oberon-type href='#Writer'>Writer</oberon-type> for stream I/O.</p>
    <p pad-after='yes' no-indent='no'>Note 0: All types and procedures declared in this module have to be considered abstract, i.e., they are never instanciated or called.  The provided procedure bodies are nothing but hints how a specific channel could start implementing them.</p>
    <p pad-after='yes' no-indent='no'>Note 1: A module implementing specific channels (e.g., files, or TCP streams) will provide the procedures</p>
    <example pad-after='yes'>PROCEDURE New* (...): Channel;
</example>
    <p pad-after='yes' no-indent='no'>and (optionally)</p>
    <example pad-after='yes'>PROCEDURE Old* (...): Channel.
</example>
    <p pad-after='yes' no-indent='no'>For channels that correspond to a piece of data that can be both read and changed, the first procedure will create a new channel for the given data location, deleting all data previously contained in it.  The latter will open a channel to the existing data.</p>
    <p pad-after='yes' no-indent='no'>For channels representing a unidirectional byte stream (like output to / input from terminal, or a TCP stream), only a procedure <samp>New</samp> is provided.  It will create a connection with the designated location.</p>
    <p pad-after='yes' no-indent='no'>The formal parameters of these procedures will include some kind of reference to the data being opened (for example, a file name) and, optionally, flags that modify the way the channel is opened (for example read-only, write-only, etc).  Their interface therefore depends on the channel and is not part of this specification.</p>
    <p pad-after='yes' no-indent='no'>Note 2: A channel implementation should state how many channels can be open simultaneously.  It's common for the OS to support just so many open files or so many open sockets at the same time.  Since this value isn't a constant, it's only required to give a statement on the number of open connections for the best case, and which factors can lower this number.</p>
    <p pad-after='yes' no-indent='no'>Note 3: A number of record fields in <samp>Channel</samp>, <samp>Reader</samp>, and <samp>Writer</samp> are exported with write permissions.  This is done to permit specializations of the classes to change these fields.  The user should consider them read-only.</p>
    <p pad-after='yes' no-indent='no'>Note: The list of error codes defined in this module only covers the most typical errors.  A specific channel implementation (like <oberon-module href='Files#'>Files</oberon-module>) will define its own list own codes, containing aliases for the codes below (when appropriate) plus error codes of its own.  Every module will provide an error context (an instance of <oberon-type href='Msg#Context'>Msg.Context</oberon-type>) to translate any code into a human readable message.</p>
  </oberon-doc>
  <import-decl name='SYSTEM' id='SYSTEM' export='no' module='SYSTEM'/>
  <import-decl name='Time' id='Time' export='no' module='Time'/>
  <import-decl name='Msg' id='Msg' export='no' module='Msg'/>
  <type-decl name='Result' id='Result' export='yes'>
    <type>
      <type-name module='Msg' name='Msg' href='Msg#Msg'/>
    </type>
  </type-decl>
  <const-decl name='noLength' id='noLength' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Result value of <oberon-proc href='#ChannelDesc.Length'>Channel.Length</oberon-proc> if the queried channel has no fixed length (for example, if it models input from keybord, or output to terminal).</summary>
      <p pad-after='yes' no-indent='yes'>Result value of <oberon-proc href='#ChannelDesc.Length'>Channel.Length</oberon-proc> if the queried channel has no fixed length (for example, if it models input from keybord, or output to terminal).</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='noPosition' id='noPosition' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Result value of <oberon-proc href='#ReaderDesc.Pos'>Reader.Pos</oberon-proc> or <oberon-proc href='#WriterDesc.Pos'>Writer.Pos</oberon-proc> if the queried rider has no concept of an indexed reading or writing position, respectively.</summary>
      <p pad-after='yes' no-indent='yes'>Result value of <oberon-proc href='#ReaderDesc.Pos'>Reader.Pos</oberon-proc> or <oberon-proc href='#WriterDesc.Pos'>Writer.Pos</oberon-proc> if the queried rider has no concept of an indexed reading or writing position, respectively.  For example, this is the case, if it models input from keybord, or output to terminal.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='done' id='done' export='yes' value='unknown'>
    <oberon-doc>
      <summary>A <samp>res</samp> value of <oberon-const href='#done'>done</oberon-const> means successful completion of the last I/O operation.</summary>
      <p pad-after='yes' no-indent='yes'>A <samp>res</samp> value of <oberon-const href='#done'>done</oberon-const> means successful completion of the last I/O operation.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='invalidChannel' id='invalidChannel' export='yes' value='unknown'>
    <oberon-doc>
      <summary>The channel channel isn't valid, e.g.</summary>
      <p pad-after='yes' no-indent='yes'>The channel channel isn't valid, e.g. because it wasn't opened in the first place or was corrupted somehow; for a rider this refers to the channel in the <samp>base</samp> field.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='writeError' id='writeError' export='yes' value='unknown'>
    <oberon-doc>
      <summary>A write error occured; usually this error happens with a writer, but for buffered channels this may also occur during a <oberon-proc href='#ChannelDesc.Flush'>Channel.Flush</oberon-proc> or a <oberon-proc href='#ChannelDesc.Close'>Channel.Close</oberon-proc>.</summary>
      <p pad-after='yes' no-indent='yes'>A write error occured; usually this error happens with a writer, but for buffered channels this may also occur during a <oberon-proc href='#ChannelDesc.Flush'>Channel.Flush</oberon-proc> or a <oberon-proc href='#ChannelDesc.Close'>Channel.Close</oberon-proc>.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='noRoom' id='noRoom' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Set if a write operation failed because there isn't any space left on the device, e.g.</summary>
      <p pad-after='yes' no-indent='yes'>Set if a write operation failed because there isn't any space left on the device, e.g. if the disk is full or you exeeded your quota.  Usually this error happens with a writer, but for buffered channels this may also occur during a <oberon-proc href='#ChannelDesc.Flush'>Channel.Flush</oberon-proc> or a <oberon-proc href='#ChannelDesc.Close'>Channel.Close</oberon-proc>.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='outOfRange' id='outOfRange' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Set if <samp>SetPos</samp> has been called with a negative argument or it has been called on a rider that doesn't support positioning.</summary>
      <p pad-after='yes' no-indent='yes'>Set if <samp>SetPos</samp> has been called with a negative argument or it has been called on a rider that doesn't support positioning.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='readAfterEnd' id='readAfterEnd' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Set if a call to <oberon-proc href='#ReaderDesc.ReadByte'>Reader.ReadByte</oberon-proc> or <oberon-proc href='#ReaderDesc.ReadBytes'>Reader.ReadBytes</oberon-proc> tries to access a byte beyond the end of the file (resp.</summary>
      <p pad-after='yes' no-indent='yes'>Set if a call to <oberon-proc href='#ReaderDesc.ReadByte'>Reader.ReadByte</oberon-proc> or <oberon-proc href='#ReaderDesc.ReadBytes'>Reader.ReadBytes</oberon-proc> tries to access a byte beyond the end of the file (resp. channel).  This means that there weren't enough bytes left or the read operation started at (or after) the end.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='channelClosed' id='channelClosed' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Set if the rider's channel has been closed, preventing any further read or write operations; this means you called <oberon-proc href='#ChannelDesc.Close'>Channel.Close</oberon-proc> (in which case you made a programming error), or the process at the other end of the channel closed the connection (examples for this are pipes, FIFOs, tcp streams).</summary>
      <p pad-after='yes' no-indent='yes'>Set if the rider's channel has been closed, preventing any further read or write operations; this means you called <oberon-proc href='#ChannelDesc.Close'>Channel.Close</oberon-proc> (in which case you made a programming error), or the process at the other end of the channel closed the connection (examples for this are pipes, FIFOs, tcp streams).</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='readError' id='readError' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Unspecified read error.</summary>
      <p pad-after='yes' no-indent='yes'>Unspecified read error.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='invalidFormat' id='invalidFormat' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Set by an interpreting Reader (e.g., <oberon-type href='TextRiders#Reader'>TextRiders.Reader</oberon-type>) if the byte stream at the current reading position doesn't represent an object of the requested type.</summary>
      <p pad-after='yes' no-indent='yes'>Set by an interpreting Reader (e.g., <oberon-type href='TextRiders#Reader'>TextRiders.Reader</oberon-type>) if the byte stream at the current reading position doesn't represent an object of the requested type.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='noReadAccess' id='noReadAccess' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Set if <oberon-proc href='#ChannelDesc.NewReader'>Channel.NewReader</oberon-proc> was called to create a reader on a channel that doesn't allow reading access.</summary>
      <p pad-after='yes' no-indent='yes'>Set if <oberon-proc href='#ChannelDesc.NewReader'>Channel.NewReader</oberon-proc> was called to create a reader on a channel that doesn't allow reading access.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='noWriteAccess' id='noWriteAccess' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Set if <oberon-proc href='#ChannelDesc.NewWriter'>Channel.NewWriter</oberon-proc> was called to create a reader on a channel that doesn't allow reading access</summary>
      <p pad-after='yes' no-indent='yes'>Set if <oberon-proc href='#ChannelDesc.NewWriter'>Channel.NewWriter</oberon-proc> was called to create a reader on a channel that doesn't allow reading access</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='closeError' id='closeError' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Set if closing the channel failed for some reason.</summary>
      <p pad-after='yes' no-indent='yes'>Set if closing the channel failed for some reason.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='noModTime' id='noModTime' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Set if no modification time is available for the given channel.</summary>
      <p pad-after='yes' no-indent='yes'>Set if no modification time is available for the given channel.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='noTmpName' id='noTmpName' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Creation of a temporary file failed because the system was unable to assign an unique name to it.</summary>
      <p pad-after='yes' no-indent='yes'>Creation of a temporary file failed because the system was unable to assign an unique name to it.  Closing or registering an existing temporary file beforehand might help.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='freeErrorCode' id='freeErrorCode' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Specific channel implemenatations can start defining their own additional error codes for <oberon-field href='#ChannelDesc.res'>Channel.res</oberon-field>, <oberon-field href='#ReaderDesc.res'>Reader.res</oberon-field>, and <oberon-field href='#WriterDesc.res'>Writer.res</oberon-field> here.</summary>
      <p pad-after='yes' no-indent='yes'>Specific channel implemenatations can start defining their own additional error codes for <oberon-field href='#ChannelDesc.res'>Channel.res</oberon-field>, <oberon-field href='#ReaderDesc.res'>Reader.res</oberon-field>, and <oberon-field href='#WriterDesc.res'>Writer.res</oberon-field> here.</p>
    </oberon-doc>
  </const-decl>
  <import-decl name='-RT0' id='-RT0' export='no' module='RT0'/>
  <import-decl name='-Object' id='-Object' export='no' module='Object'/>
  <import-decl name='-Exception' id='-Exception' export='no' module='Exception'/>
  <class name='Channel'>
    <type-decl name='Channel' id='Channel' export='yes'>
      <type>
        <pointer>
          <pointer-base>
            <type-name name='ChannelDesc' href='#ChannelDesc'/>
          </pointer-base>
        </pointer>
      </type>
    </type-decl>
    <type-decl name='ChannelDesc' id='ChannelDesc' export='yes'>
      <type>
        <record>
          <field-decl name='res' id='ChannelDesc.res' export='yes'>
            <oberon-doc>
              <summary>Error flag signalling failure of a call to <oberon-proc href='#ChannelDesc.NewReader'>Channel.NewReader</oberon-proc>, <oberon-proc href='#ChannelDesc.NewWriter'>Channel.NewWriter</oberon-proc>, <oberon-proc href='#ChannelDesc.Flush'>Channel.Flush</oberon-proc>, or <oberon-proc href='#ChannelDesc.Close'>Channel.Close</oberon-proc>.</summary>
              <p pad-after='yes' no-indent='yes'>Error flag signalling failure of a call to <oberon-proc href='#ChannelDesc.NewReader'>Channel.NewReader</oberon-proc>, <oberon-proc href='#ChannelDesc.NewWriter'>Channel.NewWriter</oberon-proc>, <oberon-proc href='#ChannelDesc.Flush'>Channel.Flush</oberon-proc>, or <oberon-proc href='#ChannelDesc.Close'>Channel.Close</oberon-proc>.  Initialized to <oberon-const href='#done'>done</oberon-const> when creating the channel.  Every operation sets this to <oberon-const href='#done'>done</oberon-const> on success, or to a message object to indicate the error source.</p>
            </oberon-doc>
            <type>
              <type-name name='Result' href='#Result'/>
            </type>
          </field-decl>
          <field-decl name='readable' id='ChannelDesc.readable' export='yes'>
            <oberon-doc>
              <summary><code>TRUE</code> iff readers can be attached to this channel with <oberon-proc href='#ChannelDesc.NewReader'>Channel.NewReader</oberon-proc>.</summary>
              <p pad-after='yes' no-indent='yes'><code>TRUE</code> iff readers can be attached to this channel with <oberon-proc href='#ChannelDesc.NewReader'>Channel.NewReader</oberon-proc>.</p>
            </oberon-doc>
            <type>
              <type-name module='#predef' name='BOOLEAN'/>
            </type>
          </field-decl>
          <field-decl name='writable' id='ChannelDesc.writable' export='yes'>
            <oberon-doc>
              <summary><code>TRUE</code> iff writers can be attached to this channel with <oberon-proc href='#ChannelDesc.NewWriter'>Channel.NewWriter</oberon-proc>.</summary>
              <p pad-after='yes' no-indent='yes'><code>TRUE</code> iff writers can be attached to this channel with <oberon-proc href='#ChannelDesc.NewWriter'>Channel.NewWriter</oberon-proc>.</p>
            </oberon-doc>
            <type>
              <type-name module='#predef' name='BOOLEAN'/>
            </type>
          </field-decl>
          <field-decl name='open' id='ChannelDesc.open' export='yes'>
            <oberon-doc>
              <summary>Channel status.</summary>
              <p pad-after='yes' no-indent='yes'>Channel status.  Set to <code>TRUE</code> on channel creation, set to <code>FALSE</code> by calling <oberon-proc href='#ChannelDesc.Close'>Channel.Close</oberon-proc>.  Closing a channel prevents all further read or write operations on it.</p>
            </oberon-doc>
            <type>
              <type-name module='#predef' name='BOOLEAN'/>
            </type>
          </field-decl>
        </record>
      </type>
    </type-decl>
    <procedure name='Length' id='ChannelDesc.Length' export='yes'>
      <oberon-doc>
        <summary>Result is the number of bytes of data that this channel refers to.</summary>
        <p pad-after='yes' no-indent='yes'>Result is the number of bytes of data that this channel refers to.  If <oberon-param href='#ChannelDesc.Length.ch'>ch</oberon-param> represents a file, then this value is the file's size.  If <oberon-param href='#ChannelDesc.Length.ch'>ch</oberon-param> has no fixed length (e.g. because it's interactive), the result is <oberon-const href='#noLength'>noLength</oberon-const>.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='ch' id='ChannelDesc.Length.ch' export='no' variable-parameter='no'>
          <type>
            <type-name name='Channel' href='#Channel'/>
          </type>
        </receiver-decl>
        <result-type>
          <type-name module='#predef' name='LONGINT'/>
        </result-type>
      </formal-parameters>
    </procedure>
    <procedure name='GetModTime' id='ChannelDesc.GetModTime' export='yes'>
      <oberon-doc>
        <summary>Retrieves the modification time of the data accessed by the given channel.</summary>
        <p pad-after='yes' no-indent='yes'>Retrieves the modification time of the data accessed by the given channel.  If no such information is avaiblable, <oberon-field href='#ChannelDesc.res'>ch.res</oberon-field> is set to <oberon-const href='#noModTime'>noModTime</oberon-const>, otherwise to <oberon-const href='#done'>done</oberon-const>.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='ch' id='ChannelDesc.GetModTime.ch' export='no' variable-parameter='no'>
          <type>
            <type-name name='Channel' href='#Channel'/>
          </type>
        </receiver-decl>
        <parameter-decl name='mtime' id='ChannelDesc.GetModTime.mtime' export='no' variable-parameter='yes'>
          <type>
            <type-name module='Time' name='TimeStamp' href='Time#TimeStamp'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='NewReader' id='ChannelDesc.NewReader' export='yes'>
      <oberon-doc>
        <summary>Attaches a new reader to the channel <oberon-param href='#ChannelDesc.NewReader.ch'>ch</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Attaches a new reader to the channel <oberon-param href='#ChannelDesc.NewReader.ch'>ch</oberon-param>.  It is placed at the very start of the channel, and its <oberon-field href='#ReaderDesc.res'>Reader.res</oberon-field> field is initialized to <oberon-const href='#done'>done</oberon-const>.  <oberon-field href='#ChannelDesc.res'>ch.res</oberon-field> is set to <oberon-const href='#done'>done</oberon-const> on success and the new reader is returned.  Otherwise result is <code>NIL</code> and <oberon-field href='#ChannelDesc.res'>ch.res</oberon-field> is changed to indicate the error cause.  Note that always the same reader is returned if the channel does not support multiple reading positions.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='ch' id='ChannelDesc.NewReader.ch' export='no' variable-parameter='no'>
          <type>
            <type-name name='Channel' href='#Channel'/>
          </type>
        </receiver-decl>
        <result-type>
          <type-name name='Reader' href='#Reader'/>
        </result-type>
      </formal-parameters>
    </procedure>
    <procedure name='NewWriter' id='ChannelDesc.NewWriter' export='yes'>
      <oberon-doc>
        <summary>Attaches a new writer to the channel <oberon-param href='#ChannelDesc.NewWriter.ch'>ch</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Attaches a new writer to the channel <oberon-param href='#ChannelDesc.NewWriter.ch'>ch</oberon-param>.  It is placed at the very start of the channel, and its <oberon-field href='#WriterDesc.res'>Writer.res</oberon-field> field is initialized to <oberon-const href='#done'>done</oberon-const>.  <oberon-field href='#ChannelDesc.res'>ch.res</oberon-field> is set to <oberon-const href='#done'>done</oberon-const> on success and the new writer is returned.  Otherwise result is <code>NIL</code> and <oberon-field href='#ChannelDesc.res'>ch.res</oberon-field> is changed to indicate the error cause.  Note that always the same reader is returned if the channel does not support multiple writing positions.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='ch' id='ChannelDesc.NewWriter.ch' export='no' variable-parameter='no'>
          <type>
            <type-name name='Channel' href='#Channel'/>
          </type>
        </receiver-decl>
        <result-type>
          <type-name name='Writer' href='#Writer'/>
        </result-type>
      </formal-parameters>
    </procedure>
    <procedure name='Flush' id='ChannelDesc.Flush' export='yes'>
      <oberon-doc>
        <summary>Flushes all buffers related to this channel.</summary>
        <p pad-after='yes' no-indent='yes'>Flushes all buffers related to this channel.  Any pending write operations are passed to the underlying OS and all buffers are marked as invalid.  The next read operation will get its data directly from the channel instead of the buffer.  If a writing error occurs during flushing, the field <oberon-field href='#ChannelDesc.res'>ch.res</oberon-field> will be changed to <oberon-const href='#writeError'>writeError</oberon-const>, otherwise it's assigned <oberon-const href='#done'>done</oberon-const>.  Note that you have to check the channel's <oberon-field href='#ChannelDesc.res'>Channel.res</oberon-field> flag after an explicit flush yourself, since none of the attached writers will notice any write error in this case.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='ch' id='ChannelDesc.Flush.ch' export='no' variable-parameter='no'>
          <type>
            <type-name name='Channel' href='#Channel'/>
          </type>
        </receiver-decl>
      </formal-parameters>
    </procedure>
    <procedure name='Close' id='ChannelDesc.Close' export='yes'>
      <oberon-doc>
        <summary>Flushes all buffers associated with <oberon-param href='#ChannelDesc.Close.ch'>ch</oberon-param>, closes the channel, and frees all system resources allocated to it.</summary>
        <p pad-after='yes' no-indent='yes'>Flushes all buffers associated with <oberon-param href='#ChannelDesc.Close.ch'>ch</oberon-param>, closes the channel, and frees all system resources allocated to it.  This invalidates all riders attached to <oberon-param href='#ChannelDesc.Close.ch'>ch</oberon-param>, and they can't be used further.  On success, i.e. if all read and write operations (including flush) completed successfully, <oberon-field href='#ChannelDesc.res'>ch.res</oberon-field> is set to <oberon-const href='#done'>done</oberon-const>.  An opened channel can only be closed once, successive calls of <oberon-proc href='#ChannelDesc.Close'>Channel.Close</oberon-proc> are undefined.  Note that unlike the Oberon System all opened channels have to be closed explicitly.  Otherwise resources allocated to them will remain blocked.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='ch' id='ChannelDesc.Close.ch' export='no' variable-parameter='no'>
          <type>
            <type-name name='Channel' href='#Channel'/>
          </type>
        </receiver-decl>
      </formal-parameters>
    </procedure>
    <procedure name='ClearError' id='ChannelDesc.ClearError' export='yes'>
      <oberon-doc>
        <summary>Sets the result flag <oberon-field href='#ChannelDesc.res'>ch.res</oberon-field> to <oberon-const href='#done'>done</oberon-const>.</summary>
        <p pad-after='yes' no-indent='yes'>Sets the result flag <oberon-field href='#ChannelDesc.res'>ch.res</oberon-field> to <oberon-const href='#done'>done</oberon-const>.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='ch' id='ChannelDesc.ClearError.ch' export='no' variable-parameter='no'>
          <type>
            <type-name name='Channel' href='#Channel'/>
          </type>
        </receiver-decl>
      </formal-parameters>
    </procedure>
  </class>
  <class name='Reader'>
    <type-decl name='Reader' id='Reader' export='yes'>
      <type>
        <pointer>
          <pointer-base>
            <type-name name='ReaderDesc' href='#ReaderDesc'/>
          </pointer-base>
        </pointer>
      </type>
    </type-decl>
    <type-decl name='ReaderDesc' id='ReaderDesc' export='yes'>
      <type>
        <record>
          <field-decl name='base' id='ReaderDesc.base' export='yes'>
            <oberon-doc>
              <summary>This field refers to the channel the <oberon-type href='#Reader'>Reader</oberon-type> is connected to.</summary>
              <p pad-after='yes' no-indent='yes'>This field refers to the channel the <oberon-type href='#Reader'>Reader</oberon-type> is connected to.</p>
            </oberon-doc>
            <type>
              <type-name name='Channel' href='#Channel'/>
            </type>
          </field-decl>
          <field-decl name='res' id='ReaderDesc.res' export='yes'>
            <oberon-doc>
              <summary>Error flag signalling failure of a call to <oberon-proc href='#ReaderDesc.ReadByte'>Reader.ReadByte</oberon-proc>, <oberon-proc href='#ReaderDesc.ReadBytes'>Reader.ReadBytes</oberon-proc>, or <oberon-proc href='#ReaderDesc.SetPos'>Reader.SetPos</oberon-proc>.</summary>
              <p pad-after='yes' no-indent='yes'>Error flag signalling failure of a call to <oberon-proc href='#ReaderDesc.ReadByte'>Reader.ReadByte</oberon-proc>, <oberon-proc href='#ReaderDesc.ReadBytes'>Reader.ReadBytes</oberon-proc>, or <oberon-proc href='#ReaderDesc.SetPos'>Reader.SetPos</oberon-proc>.  Initialized to <oberon-const href='#done'>done</oberon-const> when creating a <oberon-type href='#Reader'>Reader</oberon-type> or by calling <oberon-proc href='#ReaderDesc.ClearError'>Reader.ClearError</oberon-proc>.  The first failed reading (or <oberon-proc href='#ReaderDesc.SetPos'>Reader.SetPos</oberon-proc>) operation changes this to indicate the error, all further calls to <oberon-proc href='#ReaderDesc.ReadByte'>Reader.ReadByte</oberon-proc>, <oberon-proc href='#ReaderDesc.ReadBytes'>Reader.ReadBytes</oberon-proc>, or <oberon-proc href='#ReaderDesc.SetPos'>Reader.SetPos</oberon-proc> will be ignored until <oberon-proc href='#ReaderDesc.ClearError'>Reader.ClearError</oberon-proc> resets this flag.  This means that the successful completion of an arbitrary complex sequence of read operations can be ensured by asserting that <oberon-field href='#ReaderDesc.res'>res</oberon-field> equals <oberon-const href='#done'>done</oberon-const> beforehand and also after the last operation.</p>
            </oberon-doc>
            <type>
              <type-name name='Result' href='#Result'/>
            </type>
          </field-decl>
          <field-decl name='bytesRead' id='ReaderDesc.bytesRead' export='yes'>
            <oberon-doc>
              <summary>Set by <oberon-proc href='#ReaderDesc.ReadByte'>Reader.ReadByte</oberon-proc> and <oberon-proc href='#ReaderDesc.ReadBytes'>Reader.ReadBytes</oberon-proc> to indicate the number of bytes that were successfully read.</summary>
              <p pad-after='yes' no-indent='yes'>Set by <oberon-proc href='#ReaderDesc.ReadByte'>Reader.ReadByte</oberon-proc> and <oberon-proc href='#ReaderDesc.ReadBytes'>Reader.ReadBytes</oberon-proc> to indicate the number of bytes that were successfully read.</p>
            </oberon-doc>
            <type>
              <type-name module='#predef' name='LONGINT'/>
            </type>
          </field-decl>
          <field-decl name='positionable' id='ReaderDesc.positionable' export='yes'>
            <oberon-doc>
              <summary><code>TRUE</code> iff the Reader can be moved to another position with <oberon-proc href='#ReaderDesc.SetPos'>Reader.SetPos</oberon-proc>; for channels that can only be read sequentially, like input from keyboard, this is <code>FALSE</code>.</summary>
              <p pad-after='yes' no-indent='yes'><code>TRUE</code> iff the Reader can be moved to another position with <oberon-proc href='#ReaderDesc.SetPos'>Reader.SetPos</oberon-proc>; for channels that can only be read sequentially, like input from keyboard, this is <code>FALSE</code>.</p>
            </oberon-doc>
            <type>
              <type-name module='#predef' name='BOOLEAN'/>
            </type>
          </field-decl>
        </record>
      </type>
    </type-decl>
    <procedure name='Pos' id='ReaderDesc.Pos' export='yes'>
      <oberon-doc>
        <summary>Returns the current reading position associated with the reader <oberon-param href='#ReaderDesc.Pos.r'>r</oberon-param> in channel <oberon-field href='#ReaderDesc.base'>r.base</oberon-field>, i.e.</summary>
        <p pad-after='yes' no-indent='yes'>Returns the current reading position associated with the reader <oberon-param href='#ReaderDesc.Pos.r'>r</oberon-param> in channel <oberon-field href='#ReaderDesc.base'>r.base</oberon-field>, i.e. the index of the first byte that is read by the next call to <oberon-proc href='#ReaderDesc.ReadByte'>Reader.ReadByte</oberon-proc> resp. <oberon-proc href='#ReaderDesc.ReadBytes'>Reader.ReadBytes</oberon-proc>.  This procedure will return <oberon-const href='#noPosition'>noPosition</oberon-const> if the reader has no concept of a reading position (e.g. if it corresponds to input from keyboard), otherwise the result is not negative.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='r' id='ReaderDesc.Pos.r' export='no' variable-parameter='no'>
          <type>
            <type-name name='Reader' href='#Reader'/>
          </type>
        </receiver-decl>
        <result-type>
          <type-name module='#predef' name='LONGINT'/>
        </result-type>
      </formal-parameters>
    </procedure>
    <procedure name='Available' id='ReaderDesc.Available' export='yes'>
      <oberon-doc>
        <summary>Returns the number of bytes available for the next reading operation.</summary>
        <p pad-after='yes' no-indent='yes'>Returns the number of bytes available for the next reading operation.  For a file this is the length of the channel <oberon-field href='#ReaderDesc.base'>r.base</oberon-field> minus the current reading position, for an sequential channel (or a channel designed to handle slow transfer rates) this is the number of bytes that can be accessed without additional waiting.  The result is <samp>-1</samp> if <oberon-proc href='#ChannelDesc.Close'>Channel.Close</oberon-proc> was called for the channel, or no more byte are available and the remote end of the channel has been closed.  Note that the number of bytes returned is always a lower approximation of the number that could be read at once; for some channels or systems it might be as low as <samp>1</samp> even if tons of bytes are waiting to be processed.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='r' id='ReaderDesc.Available.r' export='no' variable-parameter='no'>
          <type>
            <type-name name='Reader' href='#Reader'/>
          </type>
        </receiver-decl>
        <result-type>
          <type-name module='#predef' name='LONGINT'/>
        </result-type>
      </formal-parameters>
    </procedure>
    <procedure name='SetPos' id='ReaderDesc.SetPos' export='yes'>
      <oberon-doc>
        <summary>Sets the reading position to <oberon-param href='#ReaderDesc.SetPos.newPos'>newPos</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Sets the reading position to <oberon-param href='#ReaderDesc.SetPos.newPos'>newPos</oberon-param>.  A negative value of <oberon-param href='#ReaderDesc.SetPos.newPos'>newPos</oberon-param> or calling this procedure for a reader that doesn't allow positioning will set <oberon-field href='#ReaderDesc.res'>r.res</oberon-field> to <oberon-const href='#outOfRange'>outOfRange</oberon-const>.  A value larger than the channel's length is legal, but the following read operation will most likely fail with an <oberon-const href='#readAfterEnd'>readAfterEnd</oberon-const> error unless the channel has grown beyond this position in the meantime.  Calls to this procedure while <samp>r.res # done</samp> will be ignored, in particular a call with <samp>r.res.code = readAfterEnd</samp> error will not reset <oberon-field href='#ReaderDesc.res'>Reader.res</oberon-field> to <oberon-const href='#done'>done</oberon-const>.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='r' id='ReaderDesc.SetPos.r' export='no' variable-parameter='no'>
          <type>
            <type-name name='Reader' href='#Reader'/>
          </type>
        </receiver-decl>
        <parameter-decl name='newPos' id='ReaderDesc.SetPos.newPos' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='ReadByte' id='ReaderDesc.ReadByte' export='yes'>
      <oberon-doc>
        <summary>Reads a single byte from the channel <oberon-field href='#ReaderDesc.base'>r.base</oberon-field> at the reading position associated with <oberon-param href='#ReaderDesc.ReadByte.r'>r</oberon-param> and places it in <oberon-param href='#ReaderDesc.ReadByte.x'>x</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Reads a single byte from the channel <oberon-field href='#ReaderDesc.base'>r.base</oberon-field> at the reading position associated with <oberon-param href='#ReaderDesc.ReadByte.r'>r</oberon-param> and places it in <oberon-param href='#ReaderDesc.ReadByte.x'>x</oberon-param>.  The reading position is moved forward by one byte on success, otherwise <oberon-field href='#ReaderDesc.res'>r.res</oberon-field> is changed to indicate the error cause.  Calling this procedure with the reader <oberon-param href='#ReaderDesc.ReadByte.r'>r</oberon-param> placed at the end (or beyond the end) of the channel will set <oberon-field href='#ReaderDesc.res'>r.res</oberon-field> to <oberon-const href='#readAfterEnd'>readAfterEnd</oberon-const>.  <oberon-field href='#ReaderDesc.bytesRead'>r.bytesRead</oberon-field> will be <samp>1</samp> on success and <samp>0</samp> on failure.  Calls to this procedure while <samp>r.res # done</samp> will be ignored.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='r' id='ReaderDesc.ReadByte.r' export='no' variable-parameter='no'>
          <type>
            <type-name name='Reader' href='#Reader'/>
          </type>
        </receiver-decl>
        <parameter-decl name='x' id='ReaderDesc.ReadByte.x' export='no' variable-parameter='yes'>
          <type>
            <type-name module='SYSTEM' name='BYTE' href='SYSTEM#BYTE'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='ReadBytes' id='ReaderDesc.ReadBytes' export='yes'>
      <oberon-doc>
        <summary>Reads <oberon-param href='#ReaderDesc.ReadBytes.n'>n</oberon-param> bytes from the channel <oberon-field href='#ReaderDesc.base'>r.base</oberon-field> at the reading position associated with <oberon-param href='#ReaderDesc.ReadBytes.r'>r</oberon-param> and places them in <oberon-param href='#ReaderDesc.ReadBytes.x'>x</oberon-param>, starting at index <oberon-param href='#ReaderDesc.ReadBytes.start'>start</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Reads <oberon-param href='#ReaderDesc.ReadBytes.n'>n</oberon-param> bytes from the channel <oberon-field href='#ReaderDesc.base'>r.base</oberon-field> at the reading position associated with <oberon-param href='#ReaderDesc.ReadBytes.r'>r</oberon-param> and places them in <oberon-param href='#ReaderDesc.ReadBytes.x'>x</oberon-param>, starting at index <oberon-param href='#ReaderDesc.ReadBytes.start'>start</oberon-param>.  The reading position is moved forward by <oberon-param href='#ReaderDesc.ReadBytes.n'>n</oberon-param> bytes on success, otherwise <oberon-field href='#ReaderDesc.res'>r.res</oberon-field> is changed to indicate the error cause.  Calling this procedure with the reader <oberon-param href='#ReaderDesc.ReadBytes.r'>r</oberon-param> placed less than <oberon-param href='#ReaderDesc.ReadBytes.n'>n</oberon-param> bytes before the end of the channel will will set <oberon-field href='#ReaderDesc.res'>r.res</oberon-field> to <oberon-const href='#readAfterEnd'>readAfterEnd</oberon-const>.  <oberon-field href='#ReaderDesc.bytesRead'>r.bytesRead</oberon-field> will hold the number of bytes that were actually read (being equal to <oberon-param href='#ReaderDesc.ReadBytes.n'>n</oberon-param> on success).  Calls to this procedure while <samp>r.res # done</samp> will be ignored.</p>
        <pre-cond pad-after='yes'>
          <p pad-after='no' no-indent='yes'><samp>(n &gt;= 0) &amp; (0 &lt;= start) &amp; (start+n &lt;= LEN (x))</samp></p>
        </pre-cond>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='r' id='ReaderDesc.ReadBytes.r' export='no' variable-parameter='no'>
          <type>
            <type-name name='Reader' href='#Reader'/>
          </type>
        </receiver-decl>
        <parameter-decl name='x' id='ReaderDesc.ReadBytes.x' export='no' variable-parameter='yes'>
          <type>
            <array>
              <element-type>
                <type-name module='SYSTEM' name='BYTE' href='SYSTEM#BYTE'/>
              </element-type>
            </array>
          </type>
        </parameter-decl>
        <parameter-decl name='start' id='ReaderDesc.ReadBytes.start' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='n' id='ReaderDesc.ReadBytes.n' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='ClearError' id='ReaderDesc.ClearError' export='yes'>
      <oberon-doc>
        <summary>Sets the result flag <oberon-field href='#ReaderDesc.res'>r.res</oberon-field> to <oberon-const href='#done'>done</oberon-const>, re-enabling further read operations on <oberon-param href='#ReaderDesc.ClearError.r'>r</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Sets the result flag <oberon-field href='#ReaderDesc.res'>r.res</oberon-field> to <oberon-const href='#done'>done</oberon-const>, re-enabling further read operations on <oberon-param href='#ReaderDesc.ClearError.r'>r</oberon-param>.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='r' id='ReaderDesc.ClearError.r' export='no' variable-parameter='no'>
          <type>
            <type-name name='Reader' href='#Reader'/>
          </type>
        </receiver-decl>
      </formal-parameters>
    </procedure>
  </class>
  <class name='Writer'>
    <type-decl name='Writer' id='Writer' export='yes'>
      <type>
        <pointer>
          <pointer-base>
            <type-name name='WriterDesc' href='#WriterDesc'/>
          </pointer-base>
        </pointer>
      </type>
    </type-decl>
    <type-decl name='WriterDesc' id='WriterDesc' export='yes'>
      <type>
        <record>
          <field-decl name='base' id='WriterDesc.base' export='yes'>
            <oberon-doc>
              <summary>This field refers to the channel the <oberon-type href='#Writer'>Writer</oberon-type> is connected to.</summary>
              <p pad-after='yes' no-indent='yes'>This field refers to the channel the <oberon-type href='#Writer'>Writer</oberon-type> is connected to.</p>
            </oberon-doc>
            <type>
              <type-name name='Channel' href='#Channel'/>
            </type>
          </field-decl>
          <field-decl name='res' id='WriterDesc.res' export='yes'>
            <oberon-doc>
              <summary>Error flag signalling failure of a call to <oberon-proc href='#WriterDesc.WriteByte'>Writer.WriteByte</oberon-proc>, <oberon-proc href='#WriterDesc.WriteBytes'>Writer.WriteBytes</oberon-proc>, or <oberon-proc href='#WriterDesc.SetPos'>Writer.SetPos</oberon-proc>.</summary>
              <p pad-after='yes' no-indent='yes'>Error flag signalling failure of a call to <oberon-proc href='#WriterDesc.WriteByte'>Writer.WriteByte</oberon-proc>, <oberon-proc href='#WriterDesc.WriteBytes'>Writer.WriteBytes</oberon-proc>, or <oberon-proc href='#WriterDesc.SetPos'>Writer.SetPos</oberon-proc>.  Initialized to <oberon-const href='#done'>done</oberon-const> when creating a <oberon-type href='#Writer'>Writer</oberon-type> or by calling <oberon-proc href='#WriterDesc.ClearError'>Writer.ClearError</oberon-proc>.  The first failed writing (or <samp>SetPos</samp>) operation changes this to indicate the error, all further calls to <oberon-proc href='#WriterDesc.WriteByte'>Writer.WriteByte</oberon-proc>, <oberon-proc href='#WriterDesc.WriteBytes'>Writer.WriteBytes</oberon-proc>, or <oberon-proc href='#WriterDesc.SetPos'>Writer.SetPos</oberon-proc> will be ignored until <oberon-proc href='#WriterDesc.ClearError'>Writer.ClearError</oberon-proc> resets this flag.  This means that the successful completion of an arbitrary complex sequence of write operations can be ensured by asserting that <oberon-field href='#WriterDesc.res'>res</oberon-field> equals <oberon-const href='#done'>done</oberon-const> beforehand and also after the last operation.  Note that due to buffering a write error may occur when flushing or closing the underlying file, so you have to check the channel's <oberon-field href='#WriterDesc.res'>res</oberon-field> field after any <oberon-proc href='#ChannelDesc.Flush'>Channel.Flush</oberon-proc> or the final <oberon-proc href='#ChannelDesc.Close'>Channel.Close</oberon-proc>, too.</p>
            </oberon-doc>
            <type>
              <type-name name='Result' href='#Result'/>
            </type>
          </field-decl>
          <field-decl name='bytesWritten' id='WriterDesc.bytesWritten' export='yes'>
            <oberon-doc>
              <summary>Set by <oberon-proc href='#WriterDesc.WriteByte'>Writer.WriteByte</oberon-proc> and <oberon-proc href='#WriterDesc.WriteBytes'>Writer.WriteBytes</oberon-proc> to indicate the number of bytes that were successfully written.</summary>
              <p pad-after='yes' no-indent='yes'>Set by <oberon-proc href='#WriterDesc.WriteByte'>Writer.WriteByte</oberon-proc> and <oberon-proc href='#WriterDesc.WriteBytes'>Writer.WriteBytes</oberon-proc> to indicate the number of bytes that were successfully written.</p>
            </oberon-doc>
            <type>
              <type-name module='#predef' name='LONGINT'/>
            </type>
          </field-decl>
          <field-decl name='positionable' id='WriterDesc.positionable' export='yes'>
            <oberon-doc>
              <summary><code>TRUE</code> iff the Writer can be moved to another position with <oberon-proc href='#WriterDesc.SetPos'>Writer.SetPos</oberon-proc>.</summary>
              <p pad-after='yes' no-indent='yes'><code>TRUE</code> iff the Writer can be moved to another position with <oberon-proc href='#WriterDesc.SetPos'>Writer.SetPos</oberon-proc>.  for channels that can only be written sequentially, like output to terminal, this is <code>FALSE</code>.</p>
            </oberon-doc>
            <type>
              <type-name module='#predef' name='BOOLEAN'/>
            </type>
          </field-decl>
        </record>
      </type>
    </type-decl>
    <procedure name='Pos' id='WriterDesc.Pos' export='yes'>
      <oberon-doc>
        <summary>Returns the current writing position associated with the writer <oberon-param href='#WriterDesc.Pos.w'>w</oberon-param> in channel <oberon-field href='#WriterDesc.base'>w.base</oberon-field>, i.e.</summary>
        <p pad-after='yes' no-indent='yes'>Returns the current writing position associated with the writer <oberon-param href='#WriterDesc.Pos.w'>w</oberon-param> in channel <oberon-field href='#WriterDesc.base'>w.base</oberon-field>, i.e. the index of the first byte that is written by the next call to <oberon-proc href='#WriterDesc.WriteByte'>Writer.WriteByte</oberon-proc> or <oberon-proc href='#WriterDesc.WriteBytes'>Writer.WriteBytes</oberon-proc>.  This procedure will return <oberon-const href='#noPosition'>noPosition</oberon-const> if the writer has no concept of a writing position (e.g. if it corresponds to output to terminal), otherwise the result is not negative.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='w' id='WriterDesc.Pos.w' export='no' variable-parameter='no'>
          <type>
            <type-name name='Writer' href='#Writer'/>
          </type>
        </receiver-decl>
        <result-type>
          <type-name module='#predef' name='LONGINT'/>
        </result-type>
      </formal-parameters>
    </procedure>
    <procedure name='SetPos' id='WriterDesc.SetPos' export='yes'>
      <oberon-doc>
        <summary>Sets the writing position to <oberon-param href='#WriterDesc.SetPos.newPos'>newPos</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Sets the writing position to <oberon-param href='#WriterDesc.SetPos.newPos'>newPos</oberon-param>.  A negative value of <oberon-param href='#WriterDesc.SetPos.newPos'>newPos</oberon-param> or calling this procedure for a writer that doesn't allow positioning will set `w.res' to <oberon-const href='#outOfRange'>outOfRange</oberon-const>.  A value larger than the channel's length is legal, the following write operation will fill the gap between the end of the channel and this position with zero bytes.  Calls to this procedure while <samp>w.res # done</samp> will be ignored.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='w' id='WriterDesc.SetPos.w' export='no' variable-parameter='no'>
          <type>
            <type-name name='Writer' href='#Writer'/>
          </type>
        </receiver-decl>
        <parameter-decl name='newPos' id='WriterDesc.SetPos.newPos' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='WriteByte' id='WriterDesc.WriteByte' export='yes'>
      <oberon-doc>
        <summary>Writes a single byte <oberon-param href='#WriterDesc.WriteByte.x'>x</oberon-param> to the channel <oberon-field href='#WriterDesc.base'>w.base</oberon-field> at the writing position associated with <oberon-param href='#WriterDesc.WriteByte.w'>w</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Writes a single byte <oberon-param href='#WriterDesc.WriteByte.x'>x</oberon-param> to the channel <oberon-field href='#WriterDesc.base'>w.base</oberon-field> at the writing position associated with <oberon-param href='#WriterDesc.WriteByte.w'>w</oberon-param>.  The writing position is moved forward by one byte on success, otherwise <oberon-field href='#WriterDesc.res'>w.res</oberon-field> is changed to indicate the error cause.  <oberon-field href='#WriterDesc.bytesWritten'>w.bytesWritten</oberon-field> will be <samp>1</samp> on success and <samp>0</samp> on failure.  Calls to this procedure while <samp>w.res # done</samp> will be ignored.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='w' id='WriterDesc.WriteByte.w' export='no' variable-parameter='no'>
          <type>
            <type-name name='Writer' href='#Writer'/>
          </type>
        </receiver-decl>
        <parameter-decl name='x' id='WriterDesc.WriteByte.x' export='no' variable-parameter='no'>
          <type>
            <type-name module='SYSTEM' name='BYTE' href='SYSTEM#BYTE'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='WriteBytes' id='WriterDesc.WriteBytes' export='yes'>
      <oberon-doc>
        <summary>Writes <oberon-param href='#WriterDesc.WriteBytes.n'>n</oberon-param> bytes from <oberon-param href='#WriterDesc.WriteBytes.x'>x</oberon-param>, starting at position <oberon-param href='#WriterDesc.WriteBytes.start'>start</oberon-param>, to the channel <oberon-field href='#WriterDesc.base'>w.base</oberon-field> at the writing position associated with <oberon-param href='#WriterDesc.WriteBytes.w'>w</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Writes <oberon-param href='#WriterDesc.WriteBytes.n'>n</oberon-param> bytes from <oberon-param href='#WriterDesc.WriteBytes.x'>x</oberon-param>, starting at position <oberon-param href='#WriterDesc.WriteBytes.start'>start</oberon-param>, to the channel <oberon-field href='#WriterDesc.base'>w.base</oberon-field> at the writing position associated with <oberon-param href='#WriterDesc.WriteBytes.w'>w</oberon-param>.  The writing position is moved forward by <oberon-param href='#WriterDesc.WriteBytes.n'>n</oberon-param> bytes on success, otherwise <oberon-field href='#WriterDesc.res'>w.res</oberon-field> is changed to indicate the error cause.  <oberon-field href='#WriterDesc.bytesWritten'>w.bytesWritten</oberon-field> will hold the number of bytes that were actually written (being equal to <oberon-param href='#WriterDesc.WriteBytes.n'>n</oberon-param> on success).  Calls to this procedure while <samp>w.res # done</samp> will be ignored.</p>
        <pre-cond pad-after='yes'>
          <p pad-after='no' no-indent='yes'><samp>(n &gt;= 0) &amp; (0 &lt;= start) &amp; (start+n &lt;= LEN (x))</samp></p>
        </pre-cond>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='w' id='WriterDesc.WriteBytes.w' export='no' variable-parameter='no'>
          <type>
            <type-name name='Writer' href='#Writer'/>
          </type>
        </receiver-decl>
        <parameter-decl name='x' id='WriterDesc.WriteBytes.x' export='no' variable-parameter='no'>
          <type>
            <array>
              <element-type>
                <type-name module='SYSTEM' name='BYTE' href='SYSTEM#BYTE'/>
              </element-type>
            </array>
          </type>
        </parameter-decl>
        <parameter-decl name='start' id='WriterDesc.WriteBytes.start' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='n' id='WriterDesc.WriteBytes.n' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='ClearError' id='WriterDesc.ClearError' export='yes'>
      <oberon-doc>
        <summary>Sets the result flag <oberon-field href='#WriterDesc.res'>w.res</oberon-field> to <oberon-const href='#done'>done</oberon-const>, re-enabling further write operations on <oberon-param href='#WriterDesc.ClearError.w'>w</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Sets the result flag <oberon-field href='#WriterDesc.res'>w.res</oberon-field> to <oberon-const href='#done'>done</oberon-const>, re-enabling further write operations on <oberon-param href='#WriterDesc.ClearError.w'>w</oberon-param>.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='w' id='WriterDesc.ClearError.w' export='no' variable-parameter='no'>
          <type>
            <type-name name='Writer' href='#Writer'/>
          </type>
        </receiver-decl>
      </formal-parameters>
    </procedure>
  </class>
  <class name='ErrorContext'>
    <type-decl name='ErrorContext' id='ErrorContext' export='no'>
      <type>
        <pointer>
          <pointer-base>
            <type-name name='ErrorContextDesc' href='#ErrorContextDesc'/>
          </pointer-base>
        </pointer>
      </type>
    </type-decl>
    <type-decl name='ErrorContextDesc' id='ErrorContextDesc' export='yes'>
      <oberon-doc>
        <summary>This record is exported, so that extensions of Channel can access the error descriptions by extending <oberon-type href='#ErrorContextDesc'>ErrorContextDesc</oberon-type>.</summary>
        <p pad-after='yes' no-indent='yes'>This record is exported, so that extensions of Channel can access the error descriptions by extending <oberon-type href='#ErrorContextDesc'>ErrorContextDesc</oberon-type>.</p>
      </oberon-doc>
      <type>
        <record/>
      </type>
    </type-decl>
    <procedure name='GetTemplate' id='ErrorContextDesc.GetTemplate' export='yes'>
      <oberon-doc>
        <summary>Translates this module's error codes into strings.</summary>
        <p pad-after='yes' no-indent='yes'>Translates this module's error codes into strings.  The string usually contains a short error description, possibly followed by some attributes to provide additional information for the problem.</p>
        <p pad-after='yes' no-indent='no'>The method should not be called directly by the user.  It is invoked by <samp>res.GetText()</samp> or <samp>res.GetLText</samp>.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='context' id='ErrorContextDesc.GetTemplate.context' export='no' variable-parameter='no'>
          <type>
            <type-name name='ErrorContext' href='#ErrorContext'/>
          </type>
        </receiver-decl>
        <parameter-decl name='msg' id='ErrorContextDesc.GetTemplate.msg' export='no' variable-parameter='no'>
          <type>
            <type-name module='Msg' name='Msg' href='Msg#Msg'/>
          </type>
        </parameter-decl>
        <parameter-decl name='templ' id='ErrorContextDesc.GetTemplate.templ' export='no' variable-parameter='yes'>
          <type>
            <type-name module='Msg' name='LString' href='Msg#LString'/>
          </type>
        </parameter-decl>
      </formal-parameters>
      <redefined-method module='Msg' name='GetTemplate' class='Context' href='Msg#ContextDesc.GetTemplate'/>
    </procedure>
    <base-class module='Msg' class='Context' href='Msg#Context'>
      <inherited-method module='Msg' name='GetTemplate' class='Context' href='Msg#ContextDesc.GetTemplate'/>
      <inherited-field module='Msg' name='id' class='Context' href='Msg#ContextDesc.id'/>
    </base-class>
  </class>
  <module-ref name='Files'>
    <ref-target type='html' relative-uri='Files.html'/>
  </module-ref>
  <module-ref name='Msg'>
    <ref-target type='html' relative-uri='Msg.html'/>
  </module-ref>
  <module-ref name='Time'>
    <ref-target type='html' relative-uri='Time.html'/>
  </module-ref>
</interface-description>
