// (C) Copyright 1978 Tripos Research Group
//     University of Cambridge
//     Computer Laboratory



// TRIPOS console handler header.

// The lines below which start with /**/ are
//  those which can be removed (by changing
//  the /**/ to ////) to make a smaller console
//  handler, as long as those lines which start
//  with //// are inserted.



GET "LIBHDR"

MANIFEST $( cg                 =  ug

            case.offset        = 'A' - 'a'
            case.mask          = NOT (- case.offset)

            n.ttyin.pkts       = 2

            input.buffer.upb   = 128
            echo.buffer.upb    = 127
            safety.area        = 12
            echo.mask          = echo.buffer.upb

            default.width      = 80


/**/        act.self.immolation=  998
            act.ttyin          =  999
            act.ttyout         = 1000

            pkt.charg          = pkt.arg1
            pkt.chres          = pkt.res1
            pkt.bufarg         = pkt.arg1
            pkt.bufres         = pkt.res1
            pkt.endarg         = pkt.arg2
            pkt.endres         = pkt.res2

            buf.task           = pkt.taskid
            buf.end            = buf.task + 1
            buf.data.size      = buf.end  + 1

            ttyin.pkt.upb      = pkt.res2
            ttyout.pkt.upb     = pkt.arg1

            char.cr            = #015
            char.rubout        = #177
            char.esc1          = #033
            char.esc2          = #033
            char.ctrla         = #001
            char.ctrlb         = #002
            char.ctrlc         = #003
            char.ctrld         = #004
            char.ctrle         = #005
            char.bs            = #010
            char.lf            = #012
/**/        char.tab           = #011

/**/        char.delete.char   = #377
/**/        line.delete.char   = #376

            at.l               =    1
            at.ncr             =    2
            at.uy              =    3
            at.r               =    4
            at.st              =    5
            at.x               =    6
/**/        at.octdig          =    7
            at.f               =    8
/**/        at.q               =    9
/**/        at.z               =   10

            in.stsiz           = 100
            out.stsiz          = 100

            console.line.words = 80
            console.line.chars =
             (console.line.words+1)*bytesperword
          $)



GLOBAL $( char.bell              :  cg +   0
          terminal.width         :  cg +   1
/**/      do.tabs                :  cg +   2
/**/      escapeout              :  cg +   3
          output.devtaskid       :  cg +   4
          input.devtaskid        :  cg +   5
          input.pkts             :  cg +   6
/**/      rubout.vdu             :  cg +   7
/**/      print.check            :  cg +   8
/**/      tagged.messages        :  cg +   9

          pending.input.queue    :  cg +  10
          pending.output.queue   :  cg +  11
          ttyout.pkt             :  cg +  12
          out.pkt.back           :  cg +  13

          current.task.number    :  cg +  15
          shared.output          :  cg +  16

          out.coroutine          :  cg +  17
          in.coroutine           :  cg +  18

          input.buffer           :  cg +  20
          input.ptr              :  cg +  21
          echo.buffer            :  cg +  22
          echo.iptr              :  cg +  23
          echo.optr              :  cg +  24
          pending.line.queue     :  cg +  25
/**/      reflect.on             :  cg +  26

/**/      rubout.started         :  cg + 177
          force.case             :  cg +  28
          force.lower            :  cg +  29

          number.of.escapes      :  cg +  30
          original.string        :  cg +  31
          escape.table           :  cg +  32

          cr.or.esc              :  cg +  33
          bell.pending           :  cg +  34

          carriage.position      :  cg +  35
/**/      print.table            :  cg +  36

/**/      esc.done               :  cg +  40
/**/      esc.done.p             :  cg +  41
       $)