C*	QXLI	- LIST CONTENTS OF SPRQUEUE.SYS ON TI:
C
	SUBROUTINE QXLI
C
	INCLUDE 'QXCM.COM/NOLIST'
C
	DIMENSION BUFO(80), KFUHD(3)
	DATA KFUHD/'PAGE','S   ','MINS'/
C
	LBTON(IBIT) = IAND(IBIT,IENT(QFOCO/2)) .NE. 0
C
C	GET FORMS AND COPIES FOR ALL ENTRIES
C
	IFO = IAND(IENT(QFOCO/2), "340) / 32		! CLEAR AND SHIFT
	ICO = IAND(IENT(QFOCO/2), "37)
	IF (LACT) IENT(QSEQ/2) = 0			! TO PREVENT OVERFLOWS
C
C	CHECK IF ITS A CONCATENATED HEADER RECORD
C
	IF (.NOT. LBTON(QFCH)) GO TO 200
	ENCODE (80, 510, BUFO) IENT(QDEV/2),BENT(QUNIT),
	1	BENT(QUIC+1),BENT(QUIC),  IENT(QCDN/2),IENT(QCUN/2),
	2	IENT(QSEQ/2), BENT(QPRI),  IFO,ICO
 510	FORMAT (A2,O2, 4X, '[',O3,',',O3,']', 1X, A2,O2,':CONCATENATED',15X,
	1	I3, I4, I3, I3, 17X)
C
C	IF /FU SWITCH BUT /CC NOT SPECIFIED, THEN WE WANT TO PRINT THE
C	SUM OF THE PAGES AND TIMES FOR THIS CONCATENATED ENTRY ON THE SAME
C	LINE AS THE CONCATENATED HEADER LINE.
C
	IPGCNT = 0
	TIME = 0
	IF (LSWTI) CALL QXCAT (BUFO(71), IPGCNT, TIME)
C
	GO TO 300
C
C	HERE FOR THE NORMAL QUEUE ENTRY
C
 200	CONTINUE
	IF (LBTON(QFCN)) IENT(QSEQ/2) = 0		! TO PREVENT OVERFLOWS
	ENCODE (80, 520, BUFO) IENT(QDEV/2),BENT(QUNIT),
	1	BENT(QUIC+1),BENT(QUIC),
	2	IENT(QSEQ/2), BENT(QPRI),  IFO,ICO
 520	FORMAT (A2,O2, 4X, '[',O3,',',O3,']',  33X,
	1	I3, I4, I3, I3, 17X)
C
C	GET THE OUTPUT FILE SPEC
C
	CALL QXBE (BUFO(19))
C
C	IF /TI SPECIFIED, GET THE PAGE COUNT AND TIME STATS FOR THE FILE
C
	IF (.NOT.LSWTI .OR. IENT(QDEV/2).EQ.'BA') GO TO 250
	BUFO(50) = 0
	CALL QXPC (BUFO(19), IENT(QDEV/2), BENT(QUNIT),
	1	TCHR, TLNCNT, IPGCNT, TIME)
	BUFO(50) = ' '
	IF (LACT .AND. LHEADR) CALL QXCAT (BUFO(71), IPGCNT, TIME)
	ENCODE (12, 540, BUFO(69)) IPGCNT, TIME
 540	FORMAT (I5,F7.1)
C
C	IF ITS CONCATENATED, BLANK OUT THE SEQUENCE #
C
 250	CONTINUE
	IF (LBTON(QFCN)) CALL SFCHR (BUFO(51), 1, 3, ' ')
	IF (LBTON(QFCN) .AND. .NOT.LHEADR) CALL SFCHR (BUFO(1), 1, 4, ' ')
C
C	PUT IN THE ACTIVE FLAG AND PRESERVE/BANNER/CONCATENATED FLAGS
C
 300	CONTINUE
	IF (LACT) BUFO(6) = '*'
	IF (LSWPD) BUFO(6) = 'D'			! DEFERRED PRINT FLAG
	IF (LBTON(QFND)) BUFO(65) = '*'
	IF (LBTON(QFNH)) BUFO(66) = 'N'
	IF (LBTON(QFCN)) BUFO(67) = 'C'
C
C	SQUASH OUT THE BLANKS
C
	CALL STBLK (BUFO, BUFO, 4)
	CALL STBLK (BUFO(9), BUFO(9), 9)
	CALL STBLK (BUFO(19), BUFO(19), 31)
	IF (LACT) CALL SFCHR (BUFO(51), 1, 3, ' ')
C
C	IF THIS IS THE FIRST TIME, PRINT THE HEADING
C
	IF (LPRHD) GO TO 350
	IF (.NOT.LSWTI) CALL SFCHR (KFUHD, 1, 12, ' ')
	WRITE (5, 530) KFUHD
 530	FORMAT (/' DEV ACT ACCOUNT   FILE SPECIFICATION              ',
	1	'SEQ PRI FO CO PBC ', 3A4 ,/)
	LPRHD = .TRUE.
 350	CONTINUE
C
C	IF /CC NOT SPECIFIED SUPPRESS PRINTING THE LINE
C
	IF (.NOT.LSWEC .AND. LBTON(QFCN) .AND. .NOT.LHEADR) GO TO 360
	NCHTY = IRNSC (BUFO, 1, 80)
	WRITE (5, 550) (BUFO(I),I=1,NCHTY)
 550	FORMAT (' ', 80A1)
	LHEADR = .FALSE.
C
 360	CONTINUE
	RETURN
	END
