# seof - send an EOF packet to the remote system integer function seof(x) include ratdef include kerdef include kercom # integer num,len,status,rpack,x,tnum,temp integer xy character alin(MAXLINE) integer aone,bone if(numtry>MAXTRY){ seof=BIGA return } else numtry=numtry+1 aone=1 bone=1 tnum=n call spack(BIGZ,tnum,0,packet) status=rpack(len,num,recpkt) if(status==BIGN){ if(n!=(num-1)){ seof=state return } } else if(status==BIGY){ if(n!=num){ seof=state return } numtry=0 call close(fd) n=mod((n+1),64) temp=getlin(filnam,morefd) if(temp==EOF){ call close(morefd) seof=BIGB return } else { fd=aopen(filnam,READ) if(fd==ERR){ temp=YES while(temp==YES){ xy=getlin(alin,morefd) if(xy==EOF){ seof=BIGB call close(morefd) return } else { call scopy(alin,aone,filnam,bone) fd=aopen(filanm,READ) if(fd^=ERR)temp=NO } } seof=BIGF return } else { seof=BIGF return } } } else if(status==FALSE){ seof=state return } else seof=BIGA return end