DEFINITION MODULE NKFdefs;

FROM K32baseTypes IMPORT

	bits32, cardinal16, cardinal32;

FROM K32types IMPORT

	fBlockNumber, nullNsp, tiiStruct;

FROM IOform IMPORT

	diskSlotSize, maxDirectInIndirect, maxDirectInJnode,
	maxIndirect, security, SLOTCHKSUM, slotNumber, subType,
	timeStamp;

FROM NKSR IMPORT

	accessLevelType;

FROM Unknown IMPORT

	EMPTYFILLSZ, emptySlot, FILESAFE, freeKind, INDEXFILLSZ,
	indirectItem, indirectKind, integrityCat0, jNode, JNODEFILLSZ,
	jNodeKind, nullPointer, reservedKind, reservedSlot,
	securityCat0, SLOTSIZE;



EXPORT QUALIFIED

	initialFreeItem, initialIndirectItem, initialJnodeItem,
	initialReservedItem, NKFdefsVERSION, NKFdefsWHAT,
	slotChecksum;

CONST
    NKFdefsVERSION = '1.4';
    NKFdefsWHAT = '@(#)NKFdefs.mod	1.4{0}';

    initialJnodeItem = jNodeKind (0, jNodeKind,
		     maxIndirect (cardinal32(65535, 65535)),
		     maxDirectInJnode (cardinal32(65535, 65535)),
		    FILESAFE,
		    security (
			tiiStruct (
			    accessLevelType(
				securityCat0,
				integrityCat0,
				bits32 ( {}, {})),
			    cardinal16 (65535), (* owner *)
			    cardinal16 (65535), (* group *)
			     {},              (* da *)
			    bits32 ({}, {})), (* priv struct *)
			subType (nullNsp, 0C, 0)),
		    slotNumber (0, 0), fBlockNumber (0, 0), cardinal16 (0),
		    cardinal16 (0), timeStamp (0, 0)  , JNODEFILLSZ(0C));

    initialIndirectItem = indirectKind (0, indirectKind,
		     maxIndirect (cardinal32(65535, 65535)),
		     maxDirectInIndirect  (cardinal32(65535, 65535)),
		    slotNumber(0,0), slotNumber(0,0),cardinal16(0),
		    INDEXFILLSZ(0C));

    initialFreeItem = freeKind (0, freeKind, EMPTYFILLSZ(0C));


    initialReservedItem = reservedKind (0, reservedKind, EMPTYFILLSZ(0C));

TYPE
    slotChkArray =  RECORD
			chk: ARRAY [0..(diskSlotSize/2)-1] OF cardinal16;
 		    END;


PROCEDURE slotChecksum (x: slotChkArray): cardinal16;


END NKFdefs.












