; 6 aug 85 esj restored send @file support ; 19 jly 85 esj removed send @file support ; 16 jly 85 esj converted ;;;;;;;;;;;;;;; SEOF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; E'F A:S(NWLS) E'O SEOF.(X) ; send an EOF packet to the other KERMIT /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERCOM /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERDEF I'R NUM,LEN,STATUS,LCLSTATE,TNUM I'R TPNAME(132),AONE,BONE,TV1,TV2,TV3 I'R XREAD G'L IFD(*),IFDFLG XREAD=0 W'R (NUMTRY.GT.MAXTRY) LCLSTATE=BIGA ;exceeded max. # of re-try, give up E'E CLOSTEXT.(FD) O'E NUMTRY=NUMTRY+1 AONE=1 BONE=1 TNUM=N TV1=BIGZ TV2=0 TV3=0 E'E SPACK.(TV1,TNUM,TV2,TV3) ;send an EOF packet to other KE STATUS=RPACK.(LEN,NUM,RECPKT) ;what is its reply ?? W'R (STATUS.EQ.BIGN) ;we got an NAK LCLSTATE=STATE F'N LCLSTATE O'R (STATUS.EQ.BIGY) ;we got a ACK W'R (N.NE.NUM) LCLSTATE=STATE ;but it was for the last packet O'E N=(N+1).MOD.64 NUMTRY=0 E'E CLOSTEXT.(FD) ;close the sending disk file ch ; are we sending multiple files? W'R IFDFLG .E. YES R'T ; yes, get the next file E'E NEXTFILE.(IFD, TPNAME) W'R TPNAME .E. 0 ; if at eof, close up shop LCLSTATE = BIGB B'K O'E ; go for next file LCLSTATE = BIGF STATUS = OPENTEXT.(TPNAME,$RD$, $CV$, FD) W'R (STATUS.NE.0) ;file exist ?? ; no, say so and try again E'E TYPOUT.(TPNAME-1,TPNAME(1)) E:E TYPEMSG.($ <--- Source file does not exist!$) E'E CLOSTEXT.(FD) LCLSTATE = BIGB O'E ; yes, all ok, convert the filename to ; kermit packet format, being careful to not ; include the ! terminator E'E CHTOIN.(TPNAME(1), FILNAME, TPNAME-1) B'K E'L E'L F'R O'E ; no more files, close up shop LCLSTATE = BIGB E'L E'L O'R (STATUS.EQ.BAD) ;there was a checksum error LCLSTATE=STATE ;try it again O'E LCLSTATE=BIGA ;we got an unexpected packet E'E CLOSTEXT.(FD) ;or error packet, abort ;transfer mode E'L E'L F'N LCLSTATE E'N