# sfile - send the name of the file we are about to send to the other KERMIT # integer function sfile(x) include ratdef include kerdef include kercom # integer num,len,count,rpack,bufill,x,tnum integer aone,aten,bone character alin(MAXLINE) string sending " Sending " if(host==FALSE){ aone=1 bone=1 aten=10 call scopy(sending,aone,alin,bone) call scopy(filnam,aone,alin,aten) call putlin(alin,localoutfd) call remark(" Packet # ") } if(numtry>MAXTRY){ sfile=BIGA return } else numtry=numtry+1 len=1 while(filnam(len)^=EOS)len=len+1 len=len-2 tnum=n call spack(BIGF,tnum,len,filnam) status=rpack(len,num,recpkt) if(status==BIGN){ if(n!=(num-1)){ sfile=state return } } else if(status==BIGY){ if(n!=num){ sfile=state return } numtry=0 n=mod((n+1),64) size=bufill(packet) sfile=BIGD return } else if(status==FALSE){ sfile=state return } else { sfile=BIGA return } return end