Google
 

Trailing-Edge - PDP-10 Archives - tops10_integ_tools_v4_10jan-86 - 70,6067/dumpr1/dumper.for
There are 7 other files named dumper.for in the archive. Click here to see a list.
	PROGRAM DUMPER
C
C       A program to read files from a DEC-10 BACKUP format
C       magtape or from a DEC-20 DUMPER format magtape.
C
C       COMLINE -- Command line from user
C       COMLEN  -- Length of command line
C       STATUS  -- Status code from I/O routines
C
	IMPLICIT COMPLEX (A-Z)
C
	INCLUDE 'DMPCOM.FOR/NOLIST'
C
	CHARACTER*255 COMLINE
	INTEGER*2 COMLEN
	INTEGER*4 STATUS
C
C       External addresses that are needed
C
	EXTERNAL DMPINIT,DMPKEY
C
C	Goodies for Control-C interrupt handling
C
	INTEGER*4 SYS$ASSIGN,SYS$QIOW,SYS$DASSGN
	EXTERNAL IO$_SETMODE,IO$M_CTRLCAST
	EXTERNAL DUMPER_NOCTLC,DUMPER_ABORT,INTHAND
	INTEGER*4 IOFUNC
C
C	Wake up America!  DUMPER is here...
C
	WRITE(*,10)
10	FORMAT(' DUMPER Version 0.8',/,' Caveat:  This is still an',
	1 ' experimental program, please be patient.',/,' Report all',
	2 ' errors with the MAIL program to SYSTEM.  For help, type',
	3 ' HELP.')
C
C	Init for Control-C Interrupt handling
C
	STATUS = SYS$ASSIGN('TT',TERCHAN,,)
	IF (.NOT.STATUS) THEN
	 CALL ERRORM(%LOC(DUMPER_NOCTLC))
	 ABFLAG = .FALSE.
	ELSE
	 ABFLAG = .TRUE.
	ENDIF
	IOFUNC = %LOC(IO$_SETMODE)+%LOC(IO$M_CTRLCAST)
C
C       Now enter the main loop.  Essentially, it inputs
C       a command line, dispatches to the appropriate
C       part of the program that handles the action desired.
C
	DONE = .FALSE.
	BLKTYP = NONE
	EOFSEEN = .TRUE.
	DO WHILE (.NOT.DONE)
	 IF (ABFLAG) THEN
	  STATUS = SYS$QIOW(,%VAL(TERCHAN),%VAL(IOFUNC),,,,
	1 INTHAND,,,,,)
	  IF (.NOT.STATUS) THEN
	   CALL ERRORM(%LOC(DUMPER_NOCTLC))
	   CALL ERRORM(STATUS)
	  ENDIF
	  ABFLAG = .FALSE.
	 ENDIF
	 SIGN = 0
	 GOVALUE = 0
	 CALL LIB$GET_INPUT(COMLINE,'Command:  ',COMLEN)
	 CALL STR$UPCASE(COMLINE(1:COMLEN),COMLINE(1:COMLEN))
	 CALL COMMAND(COMLINE(1:COMLEN),DMPINIT,DMPKEY,STATUS)
	 IF (.NOT.STATUS) WRITE(*,110)
110     FORMAT(' For help, type HELP')
	 IF (ABFLAG) CALL ERRORM(%LOC(DUMPER_ABORT))
	ENDDO
	END
	SUBROUTINE INTHAND
C
C	This will set the flags so that the DUMPER program will come
C	to a stop (a restartable one, by the way...). Normally called
C	as a result of the user typing Control-C.
C
	INCLUDE 'DMPCOM.FOR/NOLIST'
C
	GOVALUE = 0
	ABFLAG = .TRUE.
	RETURN
	END
	BLOCK DATA
C
C       Common block initialization for DUMPER
C
	INCLUDE 'DMPCOM.FOR'
	DATA SIGN,SKIPNO,DONE,GOVALUE,CHANNEL,DEVLEN,GOTDEV
	1 /0,0,.FALSE.,0,0,0,.FALSE./
	DATA EOFSEEN,FILEOK,IOMODE/.FALSE.,.FALSE.,ASCII/
	DATA DEVNAME/' '/
	INCLUDE 'DMPRES.FOR'
	DATA RESCNT/1/
	END