      SUBROUTINE MAIN
      LOGICAL*1 ARG(12)
      INTEGER PAT(132)
      INTEGER GETPAT, GETARG
      LOGICAL*1 SECT(10)
      LOGICAL*1 NAME(6)
      DATA SECT(1)/49/,SECT(2)/0/
      DATA NAME(1)/78/,NAME(2)/65/,NAME(3)/77/,NAME(4)/69/,NAME(5)/36/,N
     *AME(6)/0/
      CALL QUERY(28Husage:  intro [-s<section>].)
      IF (.NOT.(GETPAT(NAME, PAT) .EQ. -3))GOTO 23000
      CALL ERROR(19HBad karma in intro.)
23000 CONTINUE
      IF (.NOT.(GETARG(1, ARG, 12) .NE. -1))GOTO 23002
      IF (.NOT.(ARG(1) .EQ. 45 .AND. (ARG(2) .EQ. 115 .OR. ARG(2) .EQ. 8
     *3)))GOTO 23004
      CALL SCOPY(ARG, 3, SECT, 1)
      GOTO 23005
23004 CONTINUE
      CALL BADARG(ARG)
23005 CONTINUE
23002 CONTINUE
      CALL DOSYN(SECT)
      CALL DOINTR(SECT, PAT)
      RETURN
      END
      SUBROUTINE DOINTR(SECT, PAT)
      LOGICAL*1 SECT(100)
      INTEGER PAT(132)
      LOGICAL*1 INDFIL(40), SECFIL(40), NAME(40)
      LOGICAL*1 BUF(512)
      INTEGER I, JUNK, FSIZE(2), SIZE(2)
      INTEGER GETLIN, GETWRD, AGETHD, AGTLIN, MATCH
      INTEGER IFD, SFD
      INTEGER OPEN
      INTEGER*4 LPTR
      LOGICAL*1 INDSTR(7)
      LOGICAL*1 SECSTR(7)
      LOGICAL*1 ANOUNC(59)
      LOGICAL*1 TAIL(54)
      LOGICAL*1 MINUSS(3)
      DATA INDSTR(1)/126/,INDSTR(2)/109/,INDSTR(3)/97/,INDSTR(4)/110/,IN
     *DSTR(5)/47/,INDSTR(6)/105/,INDSTR(7)/0/
      DATA SECSTR(1)/126/,SECSTR(2)/109/,SECSTR(3)/97/,SECSTR(4)/110/,SE
     *CSTR(5)/47/,SECSTR(6)/115/,SECSTR(7)/0/
      DATA ANOUNC(1)/77/,ANOUNC(2)/97/,ANOUNC(3)/110/,ANOUNC(4)/117/,ANO
     *UNC(5)/97/,ANOUNC(6)/108/,ANOUNC(7)/32/,ANOUNC(8)/101/,ANOUNC(9)/1
     *10/,ANOUNC(10)/116/,ANOUNC(11)/114/,ANOUNC(12)/105/,ANOUNC(13)/101
     */,ANOUNC(14)/115/,ANOUNC(15)/32/,ANOUNC(16)/97/,ANOUNC(17)/114/,AN
     *OUNC(18)/101/,ANOUNC(19)/32/,ANOUNC(20)/97/,ANOUNC(21)/118/,ANOUNC
     *(22)/97/,ANOUNC(23)/105/,ANOUNC(24)/108/,ANOUNC(25)/97/,ANOUNC(26)
     */98/,ANOUNC(27)/108/,ANOUNC(28)/101/,ANOUNC(29)/32/,ANOUNC(30)/102
     */,ANOUNC(31)/111/,ANOUNC(32)/114/,ANOUNC(33)/32/,ANOUNC(34)/116/,A
     *NOUNC(35)/104/,ANOUNC(36)/101/,ANOUNC(37)/32/,ANOUNC(38)/102/,ANOU
     *NC(39)/111/,ANOUNC(40)/108/,ANOUNC(41)/108/,ANOUNC(42)/111/,ANOUNC
     *(43)/119/,ANOUNC(44)/105/,ANOUNC(45)/110/,ANOUNC(46)/103/,ANOUNC(4
     *7)/32/,ANOUNC(48)/105/,ANOUNC(49)/110/,ANOUNC(50)/32/,ANOUNC(51)/1
     *15/,ANOUNC(52)/101/,ANOUNC(53)/99/,ANOUNC(54)/116/,ANOUNC(55)/105/
     *,ANOUNC(56)/111/,ANOUNC(57)/110/,ANOUNC(58)/32/,ANOUNC(59)/0/
      DATA TAIL(1)/70/,TAIL(2)/111/,TAIL(3)/114/,TAIL(4)/32/,TAIL(5)/105
     */,TAIL(6)/110/,TAIL(7)/100/,TAIL(8)/105/,TAIL(9)/118/,TAIL(10)/105
     */,TAIL(11)/100/,TAIL(12)/117/,TAIL(13)/97/,TAIL(14)/108/,TAIL(15)/
     *32/,TAIL(16)/100/,TAIL(17)/101/,TAIL(18)/115/,TAIL(19)/99/,TAIL(20
     *)/114/,TAIL(21)/105/,TAIL(22)/112/,TAIL(23)/116/,TAIL(24)/105/,TAI
     *L(25)/111/,TAIL(26)/110/,TAIL(27)/115/,TAIL(28)/44/,TAIL(29)/32/,T
     *AIL(30)/116/,TAIL(31)/121/,TAIL(32)/112/,TAIL(33)/101/,TAIL(34)/32
     */,TAIL(35)/40/,TAIL(36)/102/,TAIL(37)/111/,TAIL(38)/114/,TAIL(39)/
     *32/,TAIL(40)/101/,TAIL(41)/120/,TAIL(42)/97/,TAIL(43)/109/,TAIL(44
     *)/112/,TAIL(45)/108/,TAIL(46)/101/,TAIL(47)/41/,TAIL(48)/58/,TAIL(
     *49)/10/,TAIL(50)/109/,TAIL(51)/97/,TAIL(52)/110/,TAIL(53)/32/,TAIL
     *(54)/0/
      DATA MINUSS(1)/45/,MINUSS(2)/115/,MINUSS(3)/0/
      CALL CONCAT(INDSTR, SECT, INDFIL)
      IFD = OPEN(INDFIL, 1)
      IF (.NOT.(IFD .EQ. -3))GOTO 23006
      CALL ERROR(49H? Error opening index file for specified section.)
23006 CONTINUE
      CALL CONCAT(SECSTR, SECT, SECFIL)
      SFD = OPEN(SECFIL, 1)
      IF (.NOT.(SFD .EQ. -3))GOTO 23008
      CALL CLOSE(IFD)
      CALL ERROR(54H? Error opening archive of manual entries for sectio
     *n.)
23008 CONTINUE
      CALL PUTLIN(ANOUNC, 2)
      CALL PUTLNL(SECT, 2)
      CALL PUTCH(10, 2)
23010 IF (.NOT.(GETLIN(BUF, IFD) .NE. -1))GOTO 23011
      I = 1
      JUNK = GETWRD(BUF, I, NAME)
      CALL CTOPTR(BUF, I, LPTR)
      CALL SEEK(LPTR, SFD)
      FSIZE(1) = 32767
      FSIZE(2) = 0
      IF (.NOT.(AGETHD(SFD, BUF, SIZE, FSIZE) .NE. 0))GOTO 23012
      CALL CLOSE(IFD)
      CALL CLOSE(SFD)
      CALL ERROR(44H? Badly formatted archive of manual entries.)
23012 CONTINUE
23014 IF (.NOT.(AGTLIN(BUF, SFD, SIZE) .NE. -1))GOTO 23015
      IF (.NOT.(MATCH(BUF, PAT) .EQ. 1))GOTO 23016
      JUNK = GETLIN(BUF, SFD)
      I = 1
      CALL SKIPBL(BUF, I)
23018 IF (.NOT.(BUF(I) .NE. 0))GOTO 23020
      CALL PUTCH(BUF(I), 2)
23019 I=I+1
      GOTO 23018
23020 CONTINUE
      GOTO 23015
23016 CONTINUE
      GOTO 23014
23015 CONTINUE
      GOTO 23010
23011 CONTINUE
      CALL CLOSE(IFD)
      CALL CLOSE(SFD)
      CALL PUTCH(10, 2)
      CALL PUTLIN(TAIL, 2)
      IF (.NOT.(SECT(1) .NE. 49))GOTO 23021
      CALL PUTLIN(MINUSS, 2)
      CALL PUTLIN(SECT, 2)
      CALL PUTCH(32, 2)
23021 CONTINUE
      CALL PUTLIN(NAME, 2)
      CALL PUTCH(10, 2)
      RETURN
      END
      SUBROUTINE DOSYN(SECT)
      LOGICAL*1 SECT(100)
      INTEGER EQUAL
      LOGICAL*1 CMD(4)
      LOGICAL*1 PRIM(5)
      LOGICAL*1 LIB(4)
      LOGICAL*1 PRIMER(7)
      LOGICAL*1 ONE(2)
      LOGICAL*1 TWO(2)
      LOGICAL*1 THREE(2)
      LOGICAL*1 FOUR(2)
      DATA CMD(1)/99/,CMD(2)/109/,CMD(3)/100/,CMD(4)/0/
      DATA PRIM(1)/112/,PRIM(2)/114/,PRIM(3)/105/,PRIM(4)/109/,PRIM(5)/0
     */
      DATA LIB(1)/108/,LIB(2)/105/,LIB(3)/98/,LIB(4)/0/
      DATA PRIMER(1)/112/,PRIMER(2)/114/,PRIMER(3)/105/,PRIMER(4)/109/,P
     *RIMER(5)/101/,PRIMER(6)/114/,PRIMER(7)/0/
      DATA ONE(1)/49/,ONE(2)/0/
      DATA TWO(1)/50/,TWO(2)/0/
      DATA THREE(1)/51/,THREE(2)/0/
      DATA FOUR(1)/52/,FOUR(2)/0/
      CALL FOLD(SECT)
      IF (.NOT.(EQUAL(SECT, CMD) .EQ. 1))GOTO 23023
      CALL STRCPY(ONE, SECT)
      GOTO 23024
23023 CONTINUE
      IF (.NOT.(EQUAL(SECT, PRIM) .EQ. 1))GOTO 23025
      CALL STRCPY(TWO, SECT)
      GOTO 23026
23025 CONTINUE
      IF (.NOT.(EQUAL(SECT, LIB) .EQ. 1))GOTO 23027
      CALL STRCPY(THREE, SECT)
      GOTO 23028
23027 CONTINUE
      IF (.NOT.(EQUAL(SECT, PRIMER) .EQ. 1))GOTO 23029
      CALL STRCPY(FOUR, SECT)
23029 CONTINUE
23028 CONTINUE
23026 CONTINUE
23024 CONTINUE
      RETURN
      END
