C*---------------------------------------------------------------------* C| G E T B U F : GET INPUT BUFFER FROM FILE | C*---------------------------------------------------------------------* LOGICAL FUNCTION GETBUF(INBUF,INLEN) C----------------------------------------------- COMMON DATA STRUCTURES COMMON /CFLCOM/ FILNAM(12,6),INUNIT,BEGLUN,MAXLUN,FNAMSZ,DIFFIL - ,FILDMP,ERRFIL(6),POPSTK,TRACE,QUIT,CONT INTEGER*4 FILNAM INTEGER INUNIT,BEGLUN,MAXLUN,FNAMSZ LOGICAL DIFFIL,FILDMP, QIOINP BYTE ERRFIL,POPSTK,TRACE,QUIT,CONT C----------------------------------------------- SUBPROGRAM PARAMETERS INTEGER INLEN BYTE INBUF(INLEN) C----------------------------------------------- LOCAL DATA STRUCTURES INTEGER NRDERR C----------------------------------------------- IF ORIGINAL INPUT FILE C OR "TT:" READ WITH QIO IF (INUNIT .EQ. BEGLUN) GO TO 40 IF (FILNAM(1,INUNIT-BEGLUN+1).EQ.'TT:') GO TO 40 C----------------------------------------------- READ INPUT FROM FILE C- - - - - - - - - - - - - - - - - - - - - - - - SET READ ERROR COUNT NRDERR = 0 C- - - - - - - - - - - - - - - - - - - - - - - - ASSUME END OF FILE GETBUF=.TRUE. 10 READ(INUNIT,701,END=20,ERR=30) INBUF 701 FORMAT(132A1) C- - - - - - - - - - - - - - - - - - - - - - - - SET NOT END OF FILE GETBUF=.FALSE. 20 RETURN C----------------------------------------------- READ ERROR 30 WRITE(6,703) 703 FORMAT(' SYSTEM READ ERROR, RETYPE') C- - - - - - - - - - - - - - - - - - - - - - - - INCREMENT ERROR COUNT IF (NRDERR .GT. 30) CALL EXIT NRDERR = NRDERR + 1 GO TO 10 C----------------------------------------------- READ INPUT FROM TERMINAL 40 GETBUF = QIOINP(INBUF,INLEN) C----------------------------------------------- END C*---------------------------------------------------------------------* C| B L O C K D A T A : INITIALIZE NESTED-FILE COMMON BLOCK | C*---------------------------------------------------------------------* BLOCK DATA COMMON /CFLCOM/ FILNAM(12,6),INUNIT,BEGLUN,MAXLUN,FNAMSZ,DIFFIL - ,FILDMP,ERRFIL(6),POPSTK,TRACE,QUIT,CONT INTEGER*4 FILNAM INTEGER INUNIT,BEGLUN,MAXLUN,FNAMSZ LOGICAL DIFFIL,FILDMP BYTE ERRFIL,POPSTK,TRACE,QUIT,CONT C----------------------------------------------- INTEGER*4 FILNM1(12) EQUIVALENCE (FILNAM,FILNM1) DATA FILNM1/'(MAI','N)',10*' '/ DATA INUNIT/11/,BEGLUN/11/,MAXLUN/16/,FNAMSZ/48/ DATA DIFFIL/.FALSE./,FILDMP/.FALSE./ DATA ERRFIL(1)/'C'/, POPSTK,TRACE,QUIT,CONT/'P','T','Q','C'/ END