/*
 *	FileList.h - Copyright © 1991 by S.R. & P.C.
 *
 *	Created:	07 Apr 1991  15:32:15
 *	Modified:	18 Jun 1991  23:24:32
 *
 *	Make>> make
 */


struct BufferList {
	struct BufferList *Next;
	short Size;
	BYTE Memory[1];		/* the buffer is here */
};


struct Directory {
	BPTR SrcDir;
	BPTR DestDir;
	struct MinList SuperFileList;
};


struct File {
	struct BufferList *BufferList;	/* list of file buffers */
	BPTR FH_S;
	BPTR FH_D;
	ULONG ToBeRead;
};


struct SuperFileInfo {
	struct MinNode Node;
	struct FileInfo FileInfo;	/* info on file/dir */
	union {
		struct File File;
		struct Directory Dir;
	} FileDir;
	char OldName[32];			/* old name after rename/duplicate */
	short Flags;				/* see below */
	short ActionBack;			/* browser actions to do after the Action */
};

#define	SFI_READING			0x01	/* file is being read */
#define	SFI_READ_FINISHED	0x02	/* Tell if this entry is totaly read, so it can be released */
#define SFI_REMOVE			0x04	/* this entry has to be removed */
#define SFI_NOSELECT		0x08	/* don't reselect this entry (remove asked not for an error) */
#define SFI_DIREMPTY		0x10	/* Tell if dir is empty ! */


struct BrowserDir {
	struct MinNode Node;
	BPTR DirLock;
	BPTR RootLock;
	struct MinList SuperFileList;
};


union ActionArgs {
	char NewName[32];				/* for rename/duplicate */
	char Comment[82];				/* for Set Comment */
	struct DateStamp DateStamp;		/* Actual date for touch */
	struct {	
		long Pos;
		long Neg;
	} Protection;					/* Positve and negative protection bits for protect */
};	


struct HeadFileList {
	struct MinList DirList;		/* List of browser directories containing selected entries */
	struct SelectInfo Select;	/* affect subdirs handle */
	BPTR DestDir;				/* Lock on the destination dir for copy/move/rename */
	BPTR DestRoot;				/* Lock on the root of dest dir for copy/move */
	UBYTE CopyMode;				/* No comment ! */
	UBYTE CopyFlags;			/* No comment ! */
	SHORT NumEntries;			/* Number of entries in list */
	BOOL Dirs;					/* Tell if dirs are selected */
	BOOL Vols;					/* Tell if volumes, devices, or assigns are selected */
	BOOL CopySuccessfull;		/* Used to request user if sources files should be deleted even after an error during copy (with option ALLWAYS_MOVE) */
	union ActionArgs ActionArgs;/* Args given to actions */
	long MaxBuffer;				/* Maximum memory used for files buffers */
	long StartMem;				/* Memory available before reading files */
	long ActualUse;				/* Memory used by buffers */
};

