DEFINITION MODULE FilesystemDEBUG;
(* this module contains structure dump routines for debugging 
     KSOS-32 filesystems
This MODULE is derived from some C routines used to debug the
KSOS-32 level 1 bootloader
     Tom Perrine
*)

FROM SYSTEM IMPORT ADDRESS;

FROM IOform IMPORT itemKind;
FROM IOEform IMPORT extentItem;
FROM IOFform IMPORT mountItem, jNode, indirectItem, allocSlot;

EXPORT QUALIFIED
     dumpMountItem, dumpJnodeItemPtr, dumpIndirectItemPtr, dumpExtentItem,
     dumpAllocSlotPtr;


TYPE
     jNodePtr = POINTER TO jNode;
     indirectPtr = POINTER TO indirectItem;
     allocPtr = POINTER TO allocSlot;


PROCEDURE dumpMountItem(
     label:	ARRAY OF CHAR;
     mitem:	mountItem
     );


PROCEDURE dumpExtentItem(		 (* dump extent item *)
     label:	ARRAY OF CHAR;		 (* a label *)
     eitem:	extentItem		 (* the extentItem *)
     );

PROCEDURE dumpJnodeItemPtr(		 (* dump jNode via POINTER *)
     label:	ARRAY OF CHAR;		 (* a label *)
     jptr:	ADDRESS		 (* ptr to jNode *)
     );

PROCEDURE dumpIndirectItemPtr(		 (* dump Indirect via POINTER *)
     label:	ARRAY OF CHAR;		 (* a label *)
     iptr:	ADDRESS		 (* ptr to Indirect *)
     );

PROCEDURE dumpAllocSlotPtr(		 (* dump Alloc via POINTER *)
     label:	ARRAY OF CHAR;		 (* a label *)
     allocptr:	ADDRESS		 (* ptr to Alloc *)
     );

END FilesystemDEBUG.
