// IfsLookupFileInit.bcpl -- low-cost file cache validation for CIFS
// Copyright Xerox Corporation 1982
// Last modified July 25, 1982  2:50 PM by Taft

get "IfsLookupFileServ.decl"
get "Pup1.decl"

external
[
// outgoing procedures
EnableLookupFileServ

// incoming procedures
CreateEvent; DestroyEvent; LookupFileEvent
OpenLevel1Socket; CloseLevel1Socket
SysAllocate; SysAllocateZero; FreePointer

// incoming statics
@lfs
]

//----------------------------------------------------------------------------
let EnableLookupFileServ(enable) be
//----------------------------------------------------------------------------
[
if enable ne (lfs ne 0) then
   test enable
      ifso
         [
         lfs = SysAllocateZero(lenLFS)
         lfs>>LFS.soc = SysAllocate(lenPupSoc)
         OpenLevel1Socket(lfs>>LFS.soc, table [ 0; 0; socketLookupFile ])
         lfs>>LFS.ecb = CreateEvent(LookupFileEvent)
         ]
      ifnot
         [
         DestroyEvent(lfs>>LFS.ecb)
         CloseLevel1Socket(lfs>>LFS.soc)
         FreePointer(lv lfs>>LFS.soc, lv lfs)
         ]
]