-- Copyright (C) 1981, 1982, 1984, 1985  by Xerox Corporation. All rights reserved. 
-- ServerMisc.config, Grapevine: Server kit of parts

-- HGM, 22-May-85  0:20:03
-- Brenda Hankins	 23-Aug-84 14:15:17
-- Ted Wobber	  	  2-Nov-82 12:37:05 --
-- AlHall	  	  9-Jul-82 14:54:52 --
-- Mark Johnson   	 14-Jan-82 11:44:57 --
-- Andrew Birrell 	 20-Oct-81 10:43:51 --

PACK FTPPupComHot, FTPUserHot;
PACK FTPEvent, FTPPair;

ServerMisc: CONFIGURATION
   LINKS: CODE
   IMPORTS
        Buffer, BufferOps, ByteBlt, BodyDefs, DeviceError, EnquiryDefs,
        Inline, Heap, MDSStorage, MFile, Process, ProcessOperations, ProcessorFace,
	ProtocolDefs, PupDefs, PupStream, Runtime, SLDefs, Space, SpecialMFile,
	SpecialSpace, Stream, String, System, Time, TTY 
   EXPORTS BitMapDefs, BTreeDefs, EnquiryDefs, FileDefs, FTPDefs,
   	 FTPPrivateDefs, GlassDefs, HeapDefs, IODefs, LogDefs, 
	 LogPrivateDefs, LogWatchDefs, ObjectDirDefs, PolicyDefs,
	 RestartDefs, -- ShortTermHeap -- Storage, LongTermHeap: Storage, 
	 TimeExtra, VMDefs, VMSpecial, VMStorage
   CONTROL IdleTime, MDSWatcher, Policy =
BEGIN


-- ******** Virtual Memory ******** --

[FileDefs, VMDefs, VMSpecial, VMStorage] ← 
  	VMem[Buffer, ByteBlt, Heap, LogDefs, MFile, Process, PupDefs, 
           Runtime, Space, SpecialMFile, Storage, String, Time];


-- ******** Log facilities ******** --

[LogDefs, LogWatchDefs] ← Log[Process, Storage, String, Time, VMDefs];
LogDefs ← LogDisplayCold[LogDefs, LogPrivateDefs, Process, Runtime, String,
                            Storage, LongTermHeap, Time, TTY];
[LogDefs, LogPrivateDefs] ← LogDisplayHot[Inline, Process, String, TTY];
ReadLog;
IODefs ← IO[LogPrivateDefs, TTY];


-- ******** BTree ******** --

bt: CONFIGURATION
   IMPORTS VMDefs, ShortTermHeap: Storage
   EXPORTS BTreeDefs =
   BEGIN
   BTreeSupportDefs ← BTreeSupport[ShortTermHeap, VMDefs];
   BTree2;
   BTree;
   END;

BTreeDefs ← bt[VMDefs, Storage];


-- ******** FTP package ******** --

FTPforDMS: CONFIGURATION
   IMPORTS ByteBlt, MDSStorage, Process, String,
           Time, Stream, PupDefs, PupStream
   EXPORTS FTPDefs, FTPPrivateDefs, TimeExtra =
   BEGIN
   FTPAccessories;
   FTPCold;
   FTPEvent;
   FTPPair;
   FTPProtError;
   FTPProtFiles;
   FTPProtocol;
   FTPTrace;
   FTPQueue;
   FTPUtilities;

   TimeExtraImpl;

   FTPPupComCool;
   FTPPupComHot;
   FTPServerCommon;
   FTPServerFiles;
   FTPServerMail;

   FTPUserHot;
   FTPUserCommon;
   FTPUserFiles;
   FTPUserFileNub;
   FTPUserDump;
   FTPUserRetrieve;
   FTPUserStore;
   FTPUserMailNub;
   FTPUserMailOut;
   FTPUserMailIn;
   END;

FTPforDMS;



-- ******** Disk Heap ******** --

HeapConfig: CONFIGURATION
   IMPORTS BitMapDefs, LogDefs, LogPrivateDefs, PolicyDefs, Process,
   	   ProtocolDefs, PupStream, Stream, String, Storage, System, TTY, VMDefs
   EXPORTS HeapDefs, ObjectDirDefs
   CONTROL ReaderAlloc, Reader, Writer -- they display variables -- =
   -- HeapRestart is started explicitly, and starts HeapFile and ObjectDir
   -- Compactor is started explicitly
   BEGIN
   HeapFile;
   ObjectDir;
   ReaderAlloc;
   Reader;
   Writer;
   Compactor;
   HeapRestart;
   END;

[HeapDefs, ObjectDirDefs] ← HeapConfig[
      BitMapDefs, LogDefs, LogPrivateDefs, PolicyDefs, Process, 
      ProtocolDefs, PupStream, Stream, String, LongTermHeap, System, TTY, VMDefs];



-- ******** Everything else ******** --

-- General data handling --

Storage ← StorageGVImpl[Heap];

LongTermHeap ← StorageGVImpl[Heap];

BitMapDefs ← BitMap[Inline, LongTermHeap];


-- Communications --

GlassImpl;


-- Operational facilities --

IdleTime;
MDSWatcher;
DiskWatcher;
Policy;

END.