      SUBROUTINE PLW.INIT.SUB(FLG)
*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
*
      INCLUDE PL.COMMON
      INCLUDE PL.COMMON.DEFS
      INCLUDE PL.DEFS
      INCLUDE PLIP.COMMON
      INCLUDE PLW.COMMON
*
      NM = 'CONFIG'
*
      CALL PLW.INIT.FILEOPENS(FLG)
*
      READ SRC FROM PLIP$CTRL.FD , 'CONFIG' ELSE CALL PLXX.STOP(202,'CONFIG')
      READ SRC0 FROM PLIP$CTRL.FD , 'CONFIG-CACHE-WEB' ELSE SRC0 = ''
*
      IF SRC = SRC0 THEN
         MATREAD PLW$VARS FROM PLIP$CTRL.FD , 'CONFIG-OBJ-WEB' ELSE CALL PLXX.STOP(202,'CONFIG-OBJ-WEB')
         RETURN
      END
*
      MAT PLW$VARS = ''
*
      I1 = DCOUNT(SRC,AM)
      FOR I = 1 TO I1
         W = OCONV(TRIM(FIELD(SRC<I>,'=',1)),'MCU')
         V = OCONV(TRIM(FIELD(SRC<I>,'=',2)),'MCU')
         VV = OCONV(SRC<I>,'G1=9999')
         BEGIN CASE
            CASE W = 'HTTP DIR'
               PLW$DIR<1,-1> = TRIM(VV) : SVM : 'HTTP'
            CASE W = 'RPC DIR'
               T = TRIM(VV)
               T = OCONV(T,'G0 2') : ' FILE PLIP.RPC,PAGES'
               PLW$DIR<1,-1> = T : SVM : 'RPC'
            CASE W[1,3] = 'EXT'
               N = FIELD(W,' ',2)
               T = OCONV(W,'G2 9999')
               LOCATE(N,PLW$EXT,1,1;J) ELSE
                  PLW$EXT = INSERT(PLW$EXT,1,1,J,N)
                  PLW$EXT.PARM = INSERT(PLW$EXT.PARM,1,J,0,'')
               END
               PLW$EXT.PARM<1,J,-1> = T : '=' : V
            CASE YES
         END CASE
      NEXT I
*
      MATWRITE PLW$VARS ON PLIP$CTRL.FD , 'CONFIG-OBJ-WEB'
      WRITE SRC ON PLIP$CTRL.FD , 'CONFIG-CACHE-WEB'
*$*      MATWRITE PLW$VARS ON PL$CTRL.FD , NM:'-OBJ'
*$*      WRITE SRC ON PL$CTRL.FD , NM:'-CACHE'
*
      RETURN
*
200   REM Validate V as an integer
*
      IF NOT( V MATCHES '1N0N' ) THEN
         PL_PRINT 'Invalid value ' : V
         STOP
      END
*
      RETURN
   END
