9fans.net/go@v0.0.7/cmd/sam/mesg.h.go (about)

     1  package main
     2  
     3  import "unicode/utf8"
     4  
     5  /* VERSION 1 introduces plumbing
     6  2 increases SNARFSIZE from 4096 to 32000
     7  */
     8  const VERSION = 2
     9  
    10  const (
    11  	TBLOCKSIZE = 512                           /* largest piece of text sent to terminal */
    12  	DATASIZE   = (utf8.UTFMax*TBLOCKSIZE + 30) /* ... including protocol header stuff */
    13  	SNARFSIZE  = 32000                         /* maximum length of exchanged snarf buffer, must fit in 15 bits */
    14  )
    15  
    16  /*
    17   * Messages originating at the terminal
    18   */
    19  type Tmesg int
    20  
    21  const (
    22  	Tversion Tmesg = iota
    23  	Tstartcmdfile
    24  	Tcheck
    25  	Trequest
    26  	Torigin
    27  	Tstartfile
    28  	Tworkfile
    29  	Ttype
    30  	Tcut
    31  	Tpaste
    32  	Tsnarf
    33  	Tstartnewfile
    34  	Twrite
    35  	Tclose
    36  	Tlook
    37  	Tsearch
    38  	Tsend
    39  	Tdclick
    40  	Tstartsnarf
    41  	Tsetsnarf
    42  	Tack
    43  	Texit
    44  	Tplumb
    45  	TMAX
    46  )
    47  
    48  /*
    49   * Messages originating at the host
    50   */
    51  type Hmesg int
    52  
    53  const (
    54  	Hversion Hmesg = iota
    55  	Hbindname
    56  	Hcurrent
    57  	Hnewname
    58  	Hmovname
    59  	Hgrow
    60  	Hcheck0
    61  	Hcheck
    62  	Hunlock
    63  	Hdata
    64  	Horigin
    65  	Hunlockfile
    66  	Hsetdot
    67  	Hgrowdata
    68  	Hmoveto
    69  	Hclean
    70  	Hdirty
    71  	Hcut
    72  	Hsetpat
    73  	Hdelname
    74  	Hclose
    75  	Hsetsnarf
    76  	Hsnarflen
    77  	Hack
    78  	Hexit
    79  	Hplumb
    80  	HMAX
    81  )
    82  
    83  type Header struct {
    84  	typ    Tmesg
    85  	count0 uint8
    86  	count1 uint8
    87  	data   [1]uint8
    88  }