DEFINITION MODULE flio;

FROM SYSTEM IMPORT ADDRESS;

FROM K32baseTypes IMPORT cardinal32;

FROM IOform IMPORT security;

FROM IOFform IMPORT slotNumber;

FROM bio IMPORT Btype;

FROM extio IMPORT extentDescriptor;


EXPORT QUALIFIED
	fileDescriptor,
	freej, allocj,
	creatf, openf, closef,
	seekf, freef, readf, writef;


TYPE

TYPE
	fileDescriptor = RECORD
		extDes:		extentDescriptor;
		jNumb:		slotNumber;
		fPtr:		cardinal32;
		fSize:		cardinal32;
		fMod:		BOOLEAN;
	END;


PROCEDURE freej(
	ex:		extentDescriptor;
	jn:		slotNumber
);

PROCEDURE allocj(
	ex:		extentDescriptor;
	start:		slotNumber;
	VAR slot:	slotNumber
);


PROCEDURE openf(
	VAR fl:		fileDescriptor;
	ex:		extentDescriptor;
	jn:		slotNumber
):			BOOLEAN;

PROCEDURE creatf(
	VAR fl:		fileDescriptor;
	ex:		extentDescriptor;
	VAR jn:		slotNumber;
	info:		security
):			BOOLEAN;

PROCEDURE closef(
	fl:		fileDescriptor
);

PROCEDURE seekf(
	VAR fl:		fileDescriptor;
	aptr:		cardinal32;
	flag:		INTEGER
);

PROCEDURE freef(
	VAR fl:		fileDescriptor
);

PROCEDURE findf(
	fl:		fileDescriptor;
	rw:		Btype;
	VAR addr:	CARDINAL;
	VAR maxrw:	CARDINAL
);

PROCEDURE readf(
	VAR fl:		fileDescriptor;
	abuf:		ADDRESS;
	asiz:		CARDINAL
):			INTEGER;

PROCEDURE writef(
	VAR fl:		fileDescriptor;
	abuf:		(*UNIV*) CARDINAL;
	asiz:		(*UNIV*) CARDINAL
):			INTEGER;


END flio.

