      SUBROUTINE NEWINP(NAME)
      INTEGER NAME(1)
      COMMON /COUT/OUTPA0,OUTWA0,OUTWD0,OUTBU0(1454)
      INTEGER OUTPA0,OUTWA0,OUTWD0
      INTEGER OUTBU0
      COMMON /CPAGE/START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2V
     *AL0,M3VAL0,M4VAL0,BOTTO0,EVENH0(1454),ODDHE0(1454),EVENF0(1454),OD
     *DFO0(1454)
      INTEGER START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2VAL0,M3
     *VAL0,M4VAL0,BOTTO0
      INTEGER EVENH0,ODDHE0,EVENF0,ODDFO0
      COMMON /CPARAM/FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,IN
     *VAL0,TIVAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL
     *0,ITVAL0
      INTEGER FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,INVAL0,TI
     *VAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL0,ITVAL
     *0
      COMMON /CMISC/HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0(100),FTYPE
     *0(100),OLIST0(100),OUTFI0,NEXTA0,TABSA0(134),NUMRE0(200),MCOUT0,MC
     *CHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0(180)
      INTEGER HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0,FTYPE0,OLIST0,OU
     *TFI0,NEXTA0,TABSA0,NUMRE0,MCOUT0
      INTEGER MCCHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0
      COMMON /CMACRO/MACLV0,ARGVA0(100),ARGTO0,FIRST0,MACTO0,MACBU0(5000
     *0),ARGBU0(1000)
      INTEGER MACLV0,ARGVA0,ARGTO0,FIRST0,MACTO0
      INTEGER MACBU0,ARGBU0
      COMMON /COPTS/STOPM0
      INTEGER STOPM0
      COMMON /TABCOM/COMTA0,FNTAB0,SPCHA0
      INTEGER COMTA0,FNTAB0,SPCHA0
      COMMON /DS$MEM/MEMAA0(4090)
      INTEGER MEMAA0
      INTEGER FD
      INTEGER XOPEN
      INTEGER AAAAA0(30)
      DATA AAAAA0/186,160,244,239,239,160,237,225,238,249,160,237,225,22
     *7,242,239,243,175,233,238,240,245,244,160,230,233,236,229,243,0/
      FD=XOPEN(NAME,1)
      IF((FD.EQ.-3))GOTO 10000
        FPTRA0=FPTRA0+(1)
        IF((FPTRA0.LE.100))GOTO 10001
          CALL XCLOSE(FD)
          CALL RESET0
          CALL PUTLIN(NAME,-15)
          CALL ERROR(AAAAA0)
10001   FLIST0(FPTRA0)=FD
        FTYPE0(FPTRA0)=1
        CALL REWIND(FD)
        RETURN
10000   CALL RESET0
        CALL CANT(NAME)
      END
      SUBROUTINE NEWOUT(NAME)
      INTEGER NAME(1)
      COMMON /COUT/OUTPA0,OUTWA0,OUTWD0,OUTBU0(1454)
      INTEGER OUTPA0,OUTWA0,OUTWD0
      INTEGER OUTBU0
      COMMON /CPAGE/START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2V
     *AL0,M3VAL0,M4VAL0,BOTTO0,EVENH0(1454),ODDHE0(1454),EVENF0(1454),OD
     *DFO0(1454)
      INTEGER START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2VAL0,M3
     *VAL0,M4VAL0,BOTTO0
      INTEGER EVENH0,ODDHE0,EVENF0,ODDFO0
      COMMON /CPARAM/FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,IN
     *VAL0,TIVAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL
     *0,ITVAL0
      INTEGER FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,INVAL0,TI
     *VAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL0,ITVAL
     *0
      COMMON /CMISC/HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0(100),FTYPE
     *0(100),OLIST0(100),OUTFI0,NEXTA0,TABSA0(134),NUMRE0(200),MCOUT0,MC
     *CHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0(180)
      INTEGER HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0,FTYPE0,OLIST0,OU
     *TFI0,NEXTA0,TABSA0,NUMRE0,MCOUT0
      INTEGER MCCHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0
      COMMON /CMACRO/MACLV0,ARGVA0(100),ARGTO0,FIRST0,MACTO0,MACBU0(5000
     *0),ARGBU0(1000)
      INTEGER MACLV0,ARGVA0,ARGTO0,FIRST0,MACTO0
      INTEGER MACBU0,ARGBU0
      COMMON /COPTS/STOPM0
      INTEGER STOPM0
      COMMON /TABCOM/COMTA0,FNTAB0,SPCHA0
      INTEGER COMTA0,FNTAB0,SPCHA0
      COMMON /DS$MEM/MEMAA0(4090)
      INTEGER MEMAA0
      INTEGER FD
      INTEGER XOPEN
      INTEGER AAAAB0(27)
      DATA AAAAB0/186,160,227,225,238,167,244,160,239,240,229,238,160,22
     *8,233,246,229,242,244,160,239,245,244,240,245,244,0/
      FD=XOPEN(NAME,3)
      IF((FD.NE.-3))GOTO 10002
        CALL RESET0
        CALL PUTLIN(NAME,-15)
        CALL ERROR(AAAAB0)
10002 OUTFI0=FD
      CALL WIND(FD)
      RETURN
      END
      INTEGER FUNCTION READLN(BUF,SIZE)
      INTEGER BUF(1)
      INTEGER SIZE
      COMMON /COUT/OUTPA0,OUTWA0,OUTWD0,OUTBU0(1454)
      INTEGER OUTPA0,OUTWA0,OUTWD0
      INTEGER OUTBU0
      COMMON /CPAGE/START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2V
     *AL0,M3VAL0,M4VAL0,BOTTO0,EVENH0(1454),ODDHE0(1454),EVENF0(1454),OD
     *DFO0(1454)
      INTEGER START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2VAL0,M3
     *VAL0,M4VAL0,BOTTO0
      INTEGER EVENH0,ODDHE0,EVENF0,ODDFO0
      COMMON /CPARAM/FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,IN
     *VAL0,TIVAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL
     *0,ITVAL0
      INTEGER FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,INVAL0,TI
     *VAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL0,ITVAL
     *0
      COMMON /CMISC/HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0(100),FTYPE
     *0(100),OLIST0(100),OUTFI0,NEXTA0,TABSA0(134),NUMRE0(200),MCOUT0,MC
     *CHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0(180)
      INTEGER HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0,FTYPE0,OLIST0,OU
     *TFI0,NEXTA0,TABSA0,NUMRE0,MCOUT0
      INTEGER MCCHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0
      COMMON /CMACRO/MACLV0,ARGVA0(100),ARGTO0,FIRST0,MACTO0,MACBU0(5000
     *0),ARGBU0(1000)
      INTEGER MACLV0,ARGVA0,ARGTO0,FIRST0,MACTO0
      INTEGER MACBU0,ARGBU0
      COMMON /COPTS/STOPM0
      INTEGER STOPM0
      COMMON /TABCOM/COMTA0,FNTAB0,SPCHA0
      INTEGER COMTA0,FNTAB0,SPCHA0
      COMMON /DS$MEM/MEMAA0(4090)
      INTEGER MEMAA0
      INTEGER GETLIN,GETARG,MASSIN,RDMAC
      INTEGER INBUF(1454)
10003   IF((FTYPE0(FPTRA0).NE.0))GOTO 10004
          READLN=RDMAC(INBUF,FLIST0(FPTRA0),1454)
          GOTO 10005
10004     READLN=GETLIN(INBUF,FLIST0(FPTRA0),1454)
10005   IF((READLN.EQ.-1))GOTO 10006
          READLN=MASSIN(INBUF,BUF,SIZE)
          RETURN
10006     IF((FTYPE0(FPTRA0).EQ.0))GOTO 10007
            CALL XCLOSE(FLIST0(FPTRA0))
            GOTO 10008
10007       CALL ENDMAC
10008     FPTRA0=FPTRA0-(1)
          IF((FPTRA0.LT.1))GOTO 10009
            GOTO 10003
10009     IF((GETARG(NEXTA0,FILEN0,180).NE.-1))GOTO 10011
            NOBRE0=0
            CALL BRK
            IF((LINEN0.LE.0))GOTO 10012
              CALL SPACE(10000)
10012       IF((FPTRA0.LT.1))GOTO 10013
              GOTO 10003
10013         RETURN
10011       NEXTA0=NEXTA0+(1)
            CALL NEWINP(FILEN0)
10010 GOTO 10003
      END
      SUBROUTINE RESET0
      COMMON /COUT/OUTPA0,OUTWA0,OUTWD0,OUTBU0(1454)
      INTEGER OUTPA0,OUTWA0,OUTWD0
      INTEGER OUTBU0
      COMMON /CPAGE/START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2V
     *AL0,M3VAL0,M4VAL0,BOTTO0,EVENH0(1454),ODDHE0(1454),EVENF0(1454),OD
     *DFO0(1454)
      INTEGER START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2VAL0,M3
     *VAL0,M4VAL0,BOTTO0
      INTEGER EVENH0,ODDHE0,EVENF0,ODDFO0
      COMMON /CPARAM/FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,IN
     *VAL0,TIVAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL
     *0,ITVAL0
      INTEGER FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,INVAL0,TI
     *VAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL0,ITVAL
     *0
      COMMON /CMISC/HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0(100),FTYPE
     *0(100),OLIST0(100),OUTFI0,NEXTA0,TABSA0(134),NUMRE0(200),MCOUT0,MC
     *CHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0(180)
      INTEGER HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0,FTYPE0,OLIST0,OU
     *TFI0,NEXTA0,TABSA0,NUMRE0,MCOUT0
      INTEGER MCCHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0
      COMMON /CMACRO/MACLV0,ARGVA0(100),ARGTO0,FIRST0,MACTO0,MACBU0(5000
     *0),ARGBU0(1000)
      INTEGER MACLV0,ARGVA0,ARGTO0,FIRST0,MACTO0
      INTEGER MACBU0,ARGBU0
      COMMON /COPTS/STOPM0
      INTEGER STOPM0
      COMMON /TABCOM/COMTA0,FNTAB0,SPCHA0
      INTEGER COMTA0,FNTAB0,SPCHA0
      COMMON /DS$MEM/MEMAA0(4090)
      INTEGER MEMAA0
      INTEGER I
      GOTO 10016
10014 FPTRA0=FPTRA0-(1)
10016 IF((FPTRA0.LT.1))GOTO 10015
        IF((FTYPE0(FPTRA0).NE.1))GOTO 10014
          CALL XCLOSE(FLIST0(FPTRA0))
10017 GOTO 10014
10015 DO 10018 I=1,100
        IF((OLIST0(I).EQ.-3))GOTO 10020
          CALL RMTEMP(OLIST0(I))
10020   CONTINUE
10018 CONTINUE
10019 RETURN
      END
      SUBROUTINE XCLOSE(FD)
      INTEGER FD
      COMMON /COUT/OUTPA0,OUTWA0,OUTWD0,OUTBU0(1454)
      INTEGER OUTPA0,OUTWA0,OUTWD0
      INTEGER OUTBU0
      COMMON /CPAGE/START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2V
     *AL0,M3VAL0,M4VAL0,BOTTO0,EVENH0(1454),ODDHE0(1454),EVENF0(1454),OD
     *DFO0(1454)
      INTEGER START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2VAL0,M3
     *VAL0,M4VAL0,BOTTO0
      INTEGER EVENH0,ODDHE0,EVENF0,ODDFO0
      COMMON /CPARAM/FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,IN
     *VAL0,TIVAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL
     *0,ITVAL0
      INTEGER FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,INVAL0,TI
     *VAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL0,ITVAL
     *0
      COMMON /CMISC/HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0(100),FTYPE
     *0(100),OLIST0(100),OUTFI0,NEXTA0,TABSA0(134),NUMRE0(200),MCOUT0,MC
     *CHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0(180)
      INTEGER HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0,FTYPE0,OLIST0,OU
     *TFI0,NEXTA0,TABSA0,NUMRE0,MCOUT0
      INTEGER MCCHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0
      COMMON /CMACRO/MACLV0,ARGVA0(100),ARGTO0,FIRST0,MACTO0,MACBU0(5000
     *0),ARGBU0(1000)
      INTEGER MACLV0,ARGVA0,ARGTO0,FIRST0,MACTO0
      INTEGER MACBU0,ARGBU0
      COMMON /COPTS/STOPM0
      INTEGER STOPM0
      COMMON /TABCOM/COMTA0,FNTAB0,SPCHA0
      INTEGER COMTA0,FNTAB0,SPCHA0
      COMMON /DS$MEM/MEMAA0(4090)
      INTEGER MEMAA0
      INTEGER I
      DO 10021 I=1,100
        IF((FD.NE.OLIST0(I)))GOTO 10023
          RETURN
10023   CONTINUE
10021 CONTINUE
10022 CALL CLOSE(FD)
      RETURN
      END
      INTEGER FUNCTION XOPEN(NAME,MODE)
      INTEGER NAME(1)
      INTEGER MODE
      COMMON /COUT/OUTPA0,OUTWA0,OUTWD0,OUTBU0(1454)
      INTEGER OUTPA0,OUTWA0,OUTWD0
      INTEGER OUTBU0
      COMMON /CPAGE/START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2V
     *AL0,M3VAL0,M4VAL0,BOTTO0,EVENH0(1454),ODDHE0(1454),EVENF0(1454),OD
     *DFO0(1454)
      INTEGER START0,ENDPA0,CURPA0,NEWPA0,LINEN0,PLVAL0,M1VAL0,M2VAL0,M3
     *VAL0,M4VAL0,BOTTO0
      INTEGER EVENH0,ODDHE0,EVENF0,ODDFO0
      COMMON /CPARAM/FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,IN
     *VAL0,TIVAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL
     *0,ITVAL0
      INTEGER FILLA0,NOSPA0,ADJUS0,DVFLA0,TIWID0,POVAL0,MOVAL0,INVAL0,TI
     *VAL0,LMVAL0,RMVAL0,BFVAL0,CEVAL0,ULVAL0,LSVAL0,OOVAL0,EOVAL0,ITVAL
     *0
      COMMON /CMISC/HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0(100),FTYPE
     *0(100),OLIST0(100),OUTFI0,NEXTA0,TABSA0(134),NUMRE0(200),MCOUT0,MC
     *CHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0(180)
      INTEGER HYPHE0,EXTRB0,NOBRE0,WORDL0,FPTRA0,FLIST0,FTYPE0,OLIST0,OU
     *TFI0,NEXTA0,TABSA0,NUMRE0,MCOUT0
      INTEGER MCCHA0,TMCCH0,CMDCH0,NBCCH0,REPLC0,TABCH0,FILEN0
      COMMON /CMACRO/MACLV0,ARGVA0(100),ARGTO0,FIRST0,MACTO0,MACBU0(5000
     *0),ARGBU0(1000)
      INTEGER MACLV0,ARGVA0,ARGTO0,FIRST0,MACTO0
      INTEGER MACBU0,ARGBU0
      COMMON /COPTS/STOPM0
      INTEGER STOPM0
      COMMON /TABCOM/COMTA0,FNTAB0,SPCHA0
      INTEGER COMTA0,FNTAB0,SPCHA0
      COMMON /DS$MEM/MEMAA0(4090)
      INTEGER MEMAA0
      INTEGER I,FN
      INTEGER OPEN,CTOI,MKTEMP
      I=1
      FN=CTOI(NAME,I)
      IF((NAME(1).NE.173))GOTO 10024
      IF((NAME(2).NE.0))GOTO 10024
        XOPEN=-10
        GOTO 10025
10024   IF((FN.LT.1))GOTO 10026
        IF((FN.GT.100))GOTO 10026
          IF((OLIST0(FN).NE.-3))GOTO 10027
            OLIST0(FN)=MKTEMP(3)
10027     XOPEN=OLIST0(FN)
          GOTO 10028
10026     XOPEN=OPEN(NAME,MODE)
10028 CONTINUE
10025 RETURN
      END
C ---- Long Name Map ----
C Fill                           filla0
C Nbcch                          nbcch0
C Spchartable                    spcha0
C Cmdch                          cmdch0
C Curpag                         curpa0
C Newpag                         newpa0
C Olist                          olist0
C Tabs                           tabsa0
C Tabch                          tabch0
C Mactop                         macto0
C Lineno                         linen0
C Fntable                        fntab0
C Firstmacro                     first0
C Argv                           argva0
C chktrap                        chktr0
C Evenfooter                     evenf0
C Adjust                         adjus0
C Nobreak                        nobre0
C Bfval                          bfval0
C Ceval                          ceval0
C Argtop                         argto0
C M1val                          m1val0
C Numreg                         numre0
C M2val                          m2val0
C M3val                          m3val0
C Evenheader                     evenh0
C M4val                          m4val0
C Tmcch                          tmcch0
C Nospace                        nospa0
C Stopmode                       stopm0
C processline                    proce0
C Filename                       filen0
C Outbuf                         outbu0
C Bottom                         botto0
C Fptr                           fptra0
C Oddfooter                      oddfo0
C Wordlast                       wordl0
C Extrablankmode                 extrb0
C Eoval                          eoval0
C Macbuf                         macbu0
C Comtable                       comta0
C Mem                            memaa0
C findmac                        findm0
C Startpage                      start0
C Oddheader                      oddhe0
C Inval                          inval0
C apndmac                        apndm0
C Lmval                          lmval0
C Hyphenation                    hyphe0
C Dvflag                         dvfla0
C Mcch                           mccha0
C extractfcn                     extra0
C initialize                     initi0
C Outp                           outpa0
C Plval                          plval0
C Moval                          moval0
C Outfile                        outfi0
C Tival                          tival0
C Itval                          itval0
C Nextarg                        nexta0
C Argbuf                         argbu0
C Ooval                          ooval0
C resetfiles                     reset0
C Poval                          poval0
C Rmval                          rmval0
C Lsval                          lsval0
C Flist                          flist0
C Outwds                         outwd0
C Tiwidth                        tiwid0
C Ulval                          ulval0
C evalfcn                        evalf0
C Outw                           outwa0
C Endpage                        endpa0
C Replch                         replc0
C options                        optio0
C Ftype                          ftype0
C Mcout                          mcout0
C Maclvl                         maclv0
