home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / sinclairqlb.zip / ql2hdr.bcp next >
Text File  |  1988-08-16  |  10KB  |  279 lines

  1. // This is file QL2HDR.BCP
  2. //
  3. // To be renamed FLP2_KERHDR for QDOS
  4. /*
  5.          KERMIT manifest declarations and globals
  6.  
  7.          Original version : C G Selwyn, University of Bath
  8.  
  9.          This version     : D Harper, University of Liverpool
  10.  
  11. */
  12. MANIFEST
  13. $(
  14.    version  =  1
  15.    update   =  0
  16.  
  17.    soh      =  1     // Start of header
  18.    sp       =  32    // ASCII space
  19.    cr       =  13    // ASCII Carriage return
  20.    lf       =  10    // ASCII Line Feed
  21.    bs       =  8     // ASCII backspace
  22.    bel      =  7     // ASCII bell
  23.    ff       =  12    // ASCII formfeed
  24.    del      =  127   // ASCII rubout
  25.    USC      =  31    // QConnect escape-sequence character
  26.    ctrld    =  4
  27.    brkchr   =  ctrld // Default escape character
  28.    rpack.timeout = -1 // rpack routine timeout character
  29.  
  30.    myquote  =  '#'   // Quote character I will use
  31.    mypad    =  0     // Number of padding characters I will need
  32.    mypchar  =  0     // Padding character I will need
  33.    myeol    =  '*N'  // End of line character I will need
  34.    mytime   =  5     // Seconds after which I should be timed out
  35.    myquote8 =  '&'   // My 8 bit quoting character
  36.    maxtim   =  20    // Maximum Time out interval
  37.    mintim   =  2     // Minimum time out interval
  38.    maxfiles =  10    // Maximum no. of files in argument string
  39.    null     =  0
  40.    xoff     =  'S'-'@'
  41.    xon      =  'Q'-'@'
  42.  
  43.    argvl    =  50
  44.  
  45.    w.num.commands = 13
  46.    w.s      =  1
  47.    w.r      =  2
  48.    w.c      =  3
  49.    w.e      =  4
  50.    w.help   =  5
  51.    w.set    =  6
  52.    w.show   =  7
  53.    w.server =  8
  54.    w.finish =  9
  55.    w.get    = 10
  56.    w.take   = 11
  57.    w.close  = 12
  58.    w.disconn = 13
  59.  
  60.    ws.num.commands = 27
  61.    ws.debug        =  1
  62.    ws.delay        =  2
  63.    ws.duplex       =  3
  64.    ws.8bitpfx      =  4
  65.    ws.eol          =  5
  66.    ws.escchar      =  6
  67.    ws.flowcon      =  7
  68.    ws.marker       =  8
  69.    ws.packetlength =  9
  70.    ws.padding      = 10
  71.    ws.parity       = 11
  72.    ws.pause        = 12
  73.    ws.prefix       = 13
  74.    ws.retry        = 14
  75.    ws.timeout      = 15
  76.    ws.line         = 16
  77.    ws.baud         = 17
  78.    ws.bchk         = 18
  79.    ws.handshake    = 19
  80.    ws.log          = 20
  81.    ws.overwrite    = 21
  82.    ws.repeatcount  = 22
  83.    ws.dir          = 23
  84.    ws.termtype     = 24
  85.    ws.interface    = 25
  86.    ws.padchar      = 26
  87.    ws.take.echo    = 27
  88.  
  89.    kbd.f1        = 232
  90.    kbd.f2        = 236
  91.    kbd.f3        = 240
  92.    kbd.f4        = 244
  93.    kbd.f5        = 248
  94.    kbd.esc       = 27
  95.    kbd.ctrl.esc  = 128
  96.    kbd.del       = 127
  97.    kbd.left      = #XC0
  98.    kbd.ctl.left  = #XC2
  99.  
  100.    interface.none     = 0              // No little black boxes
  101.    interface.qconnect = 1              // Tandata's little black box
  102.  
  103.  
  104.    p.plen   = 0
  105.    p.pad    = 1
  106.    p.padchar= 2
  107.    p.eol    = 3
  108.    p.sop    = 4
  109.    p.quote  = 5
  110.    p.timeout= 6
  111.    p.upb    = 6
  112.  
  113.    tickspersecond = 50                 // 50 Hz clock
  114.    ticksperminute = tickspersecond * 60
  115.    ticksperhour   = ticksperminute * 60
  116.    ticksperday    = ticksperhour   * 24
  117.  
  118.    bitsperbyte    = 10
  119. $)
  120.  
  121. GLOBAL
  122. $( size            :  ug    // Size of present data
  123. // ug+1
  124. // ug+2
  125. // ug+3           // Used by prshdr
  126. // ug+4
  127. // ug+5
  128.    n               :  ug+6  // Message number
  129.  
  130.    r.packet.length :  ug+7  // Maximum recieve packet size
  131.    r.pad           :  ug+8  // How much padding to send
  132.    r.padchar       :  ug+9  // Padding character to be received
  133.    r.eol           :  ug+10 // End of line character to be received
  134.    r.sop           :  ug+11 // Start of receive packet character
  135.    r.quote         :  ug+12 // Receive quote character
  136.    r.timeout       :  ug+13 // Timeout on receive
  137.  
  138.    s.packet.length :  ug+14 // Maximum send packet size
  139.    s.pad           :  ug+15 // How much padding to send
  140.    s.padchar       :  ug+16 // Padding character to be sent
  141.    s.eol           :  ug+17 // End of line character to be sent
  142.    s.sop           :  ug+18 // Start of packet character to send
  143.    s.quote         :  ug+19 // Send quote character
  144.    s.timeout       :  ug+20 // Timeout for my send packet
  145.  
  146.    serving         :  ug+21 // Server mode
  147.    numtry          :  ug+22 // Times this packet  retried
  148.    oldtry          :  ug+23 // Times previous packet retried
  149.    fd              :  ug+24 // Scb pointer for read/write file
  150.    remfd           :  ug+25 // Console handler number of remote line
  151.    image           :  ug+26 // True means 8 bit mode
  152.    pakcnt          :  ug+27 // No. of packets
  153.    debug           :  ug+28 // Means we're debugging (Unlucky for some)
  154.  
  155.    astate          :  ug+29 // Present state of the automaton
  156.    escchr          :  ug+30 // Connect command escape character
  157.    local.fname     :  ug+31 // Local name of current file
  158.    filnam          :  ug+32 // Current file name
  159.    recpkt          :  ug+33 // Receive packet buffer
  160.    packet          :  ug+34 // Packet buffer
  161.    readchar        :  ug+35 // Read-a-byte-from-RS233 routine
  162.    qcon.init       :  ug+36 // Tandata QConnect init flag
  163.    filecnt         :  ug+37 // Output file count
  164.    disconn         :  ug+38 // Disconnect routine
  165.    end.connect     :  ug+39 // Flag to end connect mode
  166.    console         :  ug+40 // Console stream
  167.    take.echo       :  ug+41 //
  168.    endtime         :  ug+42 // Finish time for rpack timeout
  169.    debug.fd        :  ug+43 // Debug option logging file
  170.    remote          :  ug+44 // True means we're a remote kermit
  171.    local           :  ug+45 // User kermit flag
  172.    remote.delay    :  ug+46 // Delay to sending Send-Init packet if remote
  173.    parse.table     :  ug+47 // Current parameter table vector used by the parser
  174.    argv            :  ug+48 // Argument vector
  175.    argvp           :  ug+49 // Next free slot in argument vector
  176.    numfiles        :  ug+50 // No. of files to be sent
  177.    command         :  ug+51 // sic.
  178.    cbuf            :  ug+52 // Command line buffer
  179.    cptr            :  ug+53 // Command line buffer pointer
  180.    starttime       :  ug+54 // Start time of last transfer
  181.    finishtime      :  ug+55 // Finish time of last transfer
  182.    bytes           :  ug+56 // No. of bytes transfered
  183.    quote8          :  ug+57 // 8-bit quoting character
  184.    quote8ing       :  ug+58 // Flag 8-bit quoting operational
  185.    word            :  ug+59 // Current word to send if in image mode
  186.    wptr            :  ug+60 // Pointer into above
  187.    reporting       :  ug+61 // Progress reporting flag
  188.    currentin       :  ug+62 // Current command input stream
  189.    reclevel        :  ug+63 // Recursion level
  190.    erroring        :  ug+64 // Error flag
  191.    sendchars       :  ug+65 // Current routine for sending a buffer
  192.    parse.buf       :  ug+66 // Storage for parsed command line
  193.    message.pkts    :  ug+68 // Queue of unprocessed message pkts
  194.    main.com.table  :  ug+69 // Table of main command word
  195.    set.com.table   :  ug+70 // Table of SETtable options
  196. //
  197. // These are the high-level Kermit protocol routines
  198. //
  199.    spack           :  ug+80 // Send-packet routine
  200.    rpack           :  ug+81 // Receive-packet utility
  201.    recsw           :  ug+82 // State-switcher for RECEIVE function
  202.    sendsw          :  ug+83 // State-switcher for SEND function
  203.    rpar            :  ug+84 // Routine to receive remote host's parameters
  204.    spar            :  ug+85 // Routine to send our parameters to host
  205. //
  206.    datstamp        :  ug+86 // Routine to record the time
  207.    message         :  ug+87 // Routine to send a message to the console
  208.    nwords          :  ug+88 // Number of words in the input line
  209.    connect         :  ug+89 // Terminal-emulation top-level routine
  210.    maxtry          :  ug+90 // Number of retries
  211.    maxpack         :  ug+91
  212.    set.function.table : ug+92 // Table of "SET" function addresses
  213. //
  214. // Now follow the global names of the various "SET" functions
  215. //
  216.    not.yet.implemented      :  ug+93 // For unimplemented functions
  217. //
  218.    set.debug                :  ug+94
  219.    set.delay                :  ug+95
  220.    set.8bitprefixing        :  ug+96
  221.    set.eol                  :  ug+97
  222.    set.terminal.escape      :  ug+98
  223.    set.marker               :  ug+99
  224.    set.packetlength         :  ug+100
  225.    set.padding              :  ug+101
  226.    set.parity               :  ug+102
  227.    set.pause                :  ug+103
  228.    set.prefix               :  ug+104
  229.    set.retry                :  ug+105
  230.    set.timeout              :  ug+106
  231.    set.line                 :  ug+107
  232.    set.baud                 :  ug+108
  233.    set.duplex               :  ug+109
  234.    set.interface            :  ug+110
  235.    set.handshake            :  ug+111
  236.    set.pad.char             :  ug+112
  237.    set.take.echo            :  ug+113
  238. //
  239. //
  240. // These are the globals defining the serial line characteristics
  241. //
  242.    ser.duplex               :  ug+120
  243.    ser.parity               :  ug+121
  244.    ser.baud                 :  ug+122
  245.    ser.handshake            :  ug+123
  246.    ser.line                 :  ug+124
  247.    ser.escape               :  ug+125
  248.    ser.pause                :  ug+126
  249.    ser.interface            :  ug+127
  250.    ser.name                 :  ug+128
  251.    ser.corrupt              :  ug+129
  252.    qcon.baud                :  ug+130
  253. //
  254. // More useful global routines
  255. //
  256.    do.parse                 :  ug+140
  257.    strcomp                  :  ug+141
  258.    open.serial.line         :  ug+142
  259.    find.new.file            :  ug+143
  260.    find.old.file            :  ug+144
  261.    qcon.reset               :  ug+145
  262.    qcon.initialise          :  ug+146
  263.    qcon.rdch                :  ug+147
  264.    raw.rdch                 :  ug+148
  265.    baud                     :  ug+149
  266.    do.set                   :  ug+150
  267.    show.set                 :  ug+151
  268.    ink                      :  ug+152
  269.    report                   :  ug+153
  270. //
  271. // and other globals ...
  272. //
  273.    debug.fd                 :  ug+170
  274.    sys.abort                :  ug+171          // BCPL abort routine
  275.    kermit.abort             :  ug+172          // Re-direction of ABORT
  276.    catastrophe              :  ug+173          // for private disasters !
  277.    debug.report             :  ug+174          // debugging reports
  278. $)
  279.