DEFINITION MODULE MyMisc;

(* MODULE to read the directory of a current device or directory and
   place names/sizes into DirTable  - also to Sort them in alphabetical
   order (case insensitive)
*)

FROM DOSFiles           IMPORT  FileLock;
FROM MyGlobals          IMPORT  GadgetNames;

PROCEDURE ShowMem;

PROCEDURE CheckMessages():BOOLEAN;


PROCEDURE Interrupt():BOOLEAN;


PROCEDURE ReplaceRSDM(g:GadgetNames;VAR a:ARRAY OF CHAR);


PROCEDURE ReadDirectory(lock:FileLock):BOOLEAN;
(* Returns true if good read

   DirTable[0] contains the directory record and name.
   DirTable[1] - DirTable[DirEntries] contains filenames & other info *)


(*------------*)


PROCEDURE QSort;
(* Sort the directory - DirEntries is top 1 is bottom   *)
(* Setup is bubble sort now - will change later         *)
(* Still - only 4 seconds for 230 files at that         *)

(*----------*)
PROCEDURE MoveString(VAR tgt,src:ARRAY OF CHAR; po,le:CARDINAL);
(* move max of 'le' chars of src to tgt[po] *)
(* not including ending null                *)


PROCEDURE DisplayName(file,pos:CARDINAL);


PROCEDURE DisplayFiles(ind:CARDINAL);


PROCEDURE NewDir;
(* Display a new directory *)

PROCEDURE ClearTable;

END MyMisc.
