      SUBROUTINE PLZ.PARSE.FILENAME(SRC,TP,P1,P2)
*PIC-LAN
*
*ALL
*PC
*N
*
*
*
*
******************************************************************************
******************************************************************************
***                                                                        ***
*** (C) Copyright 1990-2005 Doug Dumitru, All Rights Reserved.             ***
***                                                                        ***
*** This program is licensed under the terms of the GNU General Public     ***
*** License, version 2.0 with attached notices.                            ***
***                                                                        ***
*** The full text can be found in the LICENSE.TXT file in the              ***
*** PLIP.BP database file (the /usr/qmweb/PLIP.BP/PLIP.BP directory).      ***
***                                                                        ***
******************************************************************************
******************************************************************************
*
      INCLUDE SYS.TYPE.INCLUDE
*
*
      SRC = TRIM(SRC)
      SRC = PL_REPL(SRC,'\','/')
      W1 = FIELD(SRC,' ',1)
      BEGIN CASE
         CASE W1 = 'FILE'
            TP = 'FILE'
            P1 = FIELD(SRC,' ',2)
            P2 = OCONV(SRC,'G2 9999')
         CASE W1 = 'HOST'
            TP = 'HOST'
            P1 = ''
            P2 = OCONV(SRC,'G1 9999')
         CASE YES
*
            IF INDEX(SRC,'/',1) THEN
               TP = 'HOST'
               P1 = ''
               P2 = SRC
            END ELSE
               TP = 'FILE'
               P1 = FIELD(SRC,' ',1)
               P2 = OCONV(SRC,'G1 9999')
            END
      END CASE
*
      P2 = PL_REPL(P2,' ',AM)
*
      IF P2 = '' THEN
         EOF = NO
         LOOP
            READNEXT ID ELSE EOF = YES
         UNTIL EOF DO
            P2<-1> = ID
         REPEAT
      END
*
      IF P2 = '*' AND TP = 'FILE' THEN
         P2 = ''
         OPEN P1 TO DATA.FD THEN
            SELECT DATA.FD
            EOF = NO
            LOOP
               READNEXT ID ELSE EOF = YES
            UNTIL EOF DO
               P2<-1> = ID
            REPEAT
         END
      END
*
      RETURN
   END
