      REM CLEAR-CACHE
*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
      INCLUDE PL.INIT.INCLUDE
*
      CALL PLW.INIT.FILEOPENS('DEV')
*
      READU DUMMY FROM PL$LOCK.FD , 'CACHE' LOCKED
         PRINT 'CACHE is locked!'
         STOP
      END ELSE NULL
*
      FNAME = 'WWW.CTRL,PGCTRL'      ; FILE.FD = PL$PGCTRL.FD  ; GOSUB 100
      FNAME = 'WWW.CTRL,PGCACHE'     ; FILE.FD = PL$PGCACHE.FD ; GOSUB 100
      FNAME = 'WWW.CTRL,PGDATA'      ; FILE.FD = PL$PGDATA.FD  ; GOSUB 100
      FNAME = 'WWW.CTRL,PGBASIC'     ; FILE.FD = PL$PGBASIC.FD ; GOSUB 100
      FNAME = 'WWW.CTRL,PGBASICXREF' ; FILE.FD = PL$BASXREF.FD ; GOSUB 100
*
      DELETE PL$CTRL.FD , 'WEB.SUB.ID'
*
      FNAME = 'WWW.CTRL,PGBASIC'
      GOSUB 200
      FNAME = 'DICT WWW.CTRL'
      GOSUB 200
*
      RELEASE PL$LOCK.FD , 'CACHE'
*
      STOP
*
100   REM Clear a file
*
      PRINT 'Clearing ' : FNAME : ' ... ' :
      CLEARFILE FILE.FD
      PRINT
*
      RETURN
*
200   REM Clear WEB$ from OBJ
*
      OPEN FNAME TO OBJ.FD ELSE CALL PLXX.STOP(201,FNAME)
      PRINT 'Clearing WWW$ items from ' : FNAME : ' ... ' :
      SELECT OBJ.FD
      EOF = NO
      LOOP
         READNEXT ID ELSE EOF = YES
      UNTIL EOF DO
         IF ID[1,4] = 'WEB$' OR ID[1,5] = '!WEB$' OR ID[1,5] = '$WEB$' THEN
            DELETE OBJ.FD , ID
         END
      REPEAT
      PRINT
*
      RETURN
   END
