DEFINITION MODULE kshDirs;

FROM K32baseTypes IMPORT

	cardinal16;

FROM K32types IMPORT

	seid;

FROM IOFform IMPORT

	slotNumber;

FROM extio IMPORT

	extentDescriptor;

FROM flio IMPORT

	fileDescriptor;

FROM UDMdefs IMPORT

	Dentry;


EXPORT QUALIFIED

	mtab, pathext, parent, pathparent, path, isdirOnExtent, checkedSetdir;


TYPE
	path =		ARRAY [0..31] OF CHAR;
	mEntry =	RECORD
				mounted:	BOOLEAN;
				mRw:		BOOLEAN;
				mDevName:	path;
				mExtNo:		cardinal16;
				mName:		path;
				mExt:		extentDescriptor;
			END;

VAR
	mtab:		ARRAY [0..4] OF mEntry;



PROCEDURE pathext(
	fullp:          ARRAY OF CHAR;
	VAR ext:	extentDescriptor;
	VAR remp:       ARRAY OF CHAR
):			BOOLEAN;

PROCEDURE parent(
	ex:		extentDescriptor;
	jn:		slotNumber;
	name:           ARRAY OF CHAR;
	mustfind:	BOOLEAN;
	VAR pj:		slotNumber;
	VAR dx:		cardinal16;
	VAR dname:      ARRAY OF CHAR
):			BOOLEAN ;

PROCEDURE pathparent(
	name:           ARRAY OF CHAR;
	mustfind:	BOOLEAN;
	VAR ex:		extentDescriptor;
	VAR pj:		slotNumber;
	VAR dx:		cardinal16;
	VAR dname:      ARRAY OF CHAR
):			BOOLEAN;

PROCEDURE isdirOnExtent(
	ex:		extentDescriptor;
	jn:		slotNumber
):			BOOLEAN;

PROCEDURE checkedSetdir(
	VAR df:		fileDescriptor;
	dx:		cardinal16;
	dent:		Dentry
):                      BOOLEAN;

END kshDirs.
