      SUBROUTINE MAIN
      INTEGER I, INT, PAGE, LCNT, J, JUNK
      INTEGER GETARG, OPEN, GETLIN, GETWRD, EQUAL
      LOGICAL*1 FILE(40), LIN(400), WRD(400)
      LOGICAL*1 HDRSTR(5)
      LOGICAL*1 LIPSIS(10)
      LOGICAL*1 BIGLIP(23)
      DATA HDRSTR(1)/35/,HDRSTR(2)/45/,HDRSTR(3)/104/,HDRSTR(4)/45/,HDRS
     *TR(5)/0/
      DATA LIPSIS(1)/32/,LIPSIS(2)/32/,LIPSIS(3)/32/,LIPSIS(4)/32/,LIPSI
     *S(5)/46/,LIPSIS(6)/46/,LIPSIS(7)/46/,LIPSIS(8)/46/,LIPSIS(9)/46/,L
     *IPSIS(10)/0/
      DATA BIGLIP(1)/32/,BIGLIP(2)/32/,BIGLIP(3)/32/,BIGLIP(4)/32/,BIGLI
     *P(5)/32/,BIGLIP(6)/32/,BIGLIP(7)/32/,BIGLIP(8)/32/,BIGLIP(9)/32/,B
     *IGLIP(10)/32/,BIGLIP(11)/32/,BIGLIP(12)/32/,BIGLIP(13)/32/,BIGLIP(
     *14)/32/,BIGLIP(15)/32/,BIGLIP(16)/32/,BIGLIP(17)/32/,BIGLIP(18)/32
     */,BIGLIP(19)/80/,BIGLIP(20)/97/,BIGLIP(21)/103/,BIGLIP(22)/101/,BI
     *GLIP(23)/0/
      I=1
23000 IF(.NOT.(GETARG(I, FILE, 40) .NE. -1))GOTO 23002
      INT = OPEN(FILE, 1)
      IF(.NOT.(INT .EQ. -3))GOTO 23003
      CALL CANT(FILE)
23003 CONTINUE
      IF(.NOT.(I .GT. 1))GOTO 23005
      CALL PUTCH(12, 2)
23005 CONTINUE
      CALL MKPATH(FILE, WRD)
      CALL PUTLIN(WRD, 2)
      CALL PUTCH(10, 2)
      PAGE = 0
      LCNT = 0
23007 IF(.NOT.(GETLIN(LIN, INT) .NE. -1))GOTO 23008
      J = 1
      JUNK = GETWRD(LIN, J, WRD)
      IF(.NOT.(EQUAL(WRD, HDRSTR) .EQ. 1))GOTO 23009
      PAGE = PAGE + 1
      CALL SKIPBL(LIN, J)
      CALL PUTHDR(LIN(J), LIPSIS, PAGE)
      LCNT = 1
      GOTO 23010
23009 CONTINUE
      IF(.NOT.(LCNT .GE. 60))GOTO 23011
      PAGE = PAGE + 1
      LCNT = 1
      GOTO 23012
23011 CONTINUE
      LCNT = LCNT + 1
23012 CONTINUE
23010 CONTINUE
      GOTO 23007
23008 CONTINUE
      CALL CLOSE(INT)
      INT = OPEN(FILE, 1)
      PAGE = 0
      LCNT = 0
23013 IF(.NOT.(GETLIN(LIN, INT) .NE. -1))GOTO 23014
      J = 1
      JUNK = GETWRD(LIN, J, WRD)
      IF(.NOT.(EQUAL(WRD, HDRSTR) .EQ. 1))GOTO 23015
      PAGE = PAGE + 1
      CALL PUTCH(12, 2)
      CALL PUTHDR(LIN, BIGLIP, PAGE)
      LCNT = 1
      GOTO 23016
23015 CONTINUE
      IF(.NOT.(LCNT .GE. 60))GOTO 23017
      PAGE = PAGE + 1
      CALL PUTCH(12, 2)
      LCNT = 1
      CALL PUTLIN(LIN, 2)
      GOTO 23018
23017 CONTINUE
      LCNT = LCNT + 1
      CALL PUTLIN(LIN, 2)
23018 CONTINUE
23016 CONTINUE
      GOTO 23013
23014 CONTINUE
      CALL CLOSE(INT)
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      RETURN
      END
      SUBROUTINE PUTHDR(FIRST, MIDDLE, PAGE)
      LOGICAL*1 FIRST(100), MIDDLE(100)
      INTEGER PAGE, I
      I=1
23019 IF(.NOT.(FIRST(I) .NE. 10 .AND. FIRST(I) .NE. 0))GOTO 23021
      CALL PUTCH(FIRST(I), 2)
23020 I=I+1
      GOTO 23019
23021 CONTINUE
      CALL PUTLIN(MIDDLE, 2)
      CALL PUTDEC(PAGE, 5)
      CALL PUTCH(10, 2)
      RETURN
      END
