DEFINITION MODULE extio;

FROM K32baseTypes IMPORT

	cardinal16, integer16;

FROM IOform IMPORT

	diskBlock, genericSlot, mBlockNumber, slotNumber;

EXPORT QUALIFIED

	allocb, closex, extentDescriptor, flushx, freeb, openx, readb,
	readj, readx, writeb, writej, writex;

TYPE
	jBlock = diskBlock;
	extentDescriptor = cardinal16;

(*
 * Procedures for manipulating the disk blocks that comprise an entire extent.
 *)

PROCEDURE openx(
	VAR ex : extentDescriptor;
	devn : ARRAY OF CHAR;
	extn : cardinal16;
	mode : integer16
	) : BOOLEAN;

PROCEDURE readx(
	ex : extentDescriptor;
	bno : mBlockNumber;
	VAR buf : jBlock
	);

PROCEDURE writex(
	ex : extentDescriptor;
	bno : mBlockNumber;
	buf : jBlock
	);

PROCEDURE flushx(
	ex : extentDescriptor
	);

PROCEDURE closex(
	ex : extentDescriptor
	);

(*
 * Procedures for manipulating the jNodes in an extent.
 *)

PROCEDURE readj(
	ex : extentDescriptor;
	jn : slotNumber;
	VAR jnode : genericSlot
	) : BOOLEAN;

PROCEDURE writej(
	ex : extentDescriptor;
	jn : slotNumber;
	jnode : genericSlot
	);

(*
 * Procedures for manipulating the data blocks in an extent.
 *)

PROCEDURE allocb(
	ex : extentDescriptor;
	VAR block : mBlockNumber
	);

PROCEDURE freeb(
	ex : extentDescriptor;
	block : mBlockNumber
	);

PROCEDURE readb(
	ex : extentDescriptor;
	bno : mBlockNumber;
	VAR buf : jBlock
	);

PROCEDURE writeb(
	ex : extentDescriptor;
	bno : mBlockNumber;
	buf : jBlock
	);

END extio.
