DEFINITION MODULE IFFParseD; (*$ Implementation:=FALSE *)
(* 16-Apr-1992/cn *)

FROM SYSTEM IMPORT ADDRESS,BITSET,CAST;
FROM ExecD IMPORT MinNode,MsgPort;
FROM Clipboard IMPORT IOClipReq;

CONST
  iffparseName="iffparse.library";

TYPE
 IFFFlags=(
  write,fSeek,rSeek,iff3,iff4,iff5,iff6,iff7,iff8,iff9,iff10,iff11,
  iff12,iff13,iff14,iff15,iff16
 );
 IFFFlagSet=SET OF IFFFlags;

 IFFHandle=RECORD
  stream:ADDRESS;
  flags:IFFFlagSet;
  depth:LONGINT;
 END;
 IFFHandlePtr=POINTER TO IFFHandle;

CONST
 iffRead=IFFFlagSet{};
 iffWrite=IFFFlagSet{write};

TYPE
 IFFStreamCmd=RECORD
  command:LONGINT;
  buf:ADDRESS;
  nBytes:LONGINT;
 END;
 IFFStreamCmdPtr=POINTER TO IFFStreamCmd;

 ContextNode=RECORD
  node:MinNode;
  id:LONGINT;
  type:LONGINT;
  size:LONGINT;
  scan:LONGINT;
 END;
 ContextNodePtr=POINTER TO ContextNode;

 LocalContextItem=RECORD
  node:MinNode;
  id:LONGCARD;
  type:LONGCARD;
  ident:LONGCARD;
 END;
 LocalContextItemPtr=POINTER TO LocalContextItem;

 StoredProperty=RECORD
  size:LONGINT;
  data:ADDRESS;
 END;
 StoredPropertyPtr=POINTER TO StoredProperty;

 CollectionItemPtr=POINTER TO CollectionItem;
 CollectionItem=RECORD
  next:CollectionItemPtr;
  size:LONGINT;
  data:ADDRESS;
 END;

 ClipboardHandle=RECORD
  req:IOClipReq;
  cbPort:MsgPort;
  satisfyPort:MsgPort;
 END;
 ClipboardHandlePtr=POINTER TO ClipboardHandle;

CONST
 ifferrEof=-1;
 ifferrEoc=-2;
 ifferrNoscope=-3;
 ifferrNomem=-4;
 ifferrRead=-5;
 ifferrWrite=-6;
 ifferrSeek=-7;
 ifferrMangled=-8;
 ifferrSyntax=-9;
 ifferrNotiff=-10;
 ifferrNohook=-11;
 iffReturn2client=-12;

 idFORM=CAST(LONGINT,'FORM');
 idLIST=CAST(LONGINT,'LIST');
 idCAT=CAST(LONGINT,'CAT ');
 idPROP=CAST(LONGINT,'PROP');
 idNULL=CAST(LONGINT,'    ');

 ifflciPROP=CAST(LONGINT,'prop');
 ifflciCOLLECTION=CAST(LONGINT,'coll');
 ifflciENTRYHANDLER=CAST(LONGINT,'enhd');
 ifflciEXITHANDLER=CAST(LONGINT,'exhd');

 iffparseScan=0;
 iffparseStep=1;
 iffparseRawstep=2;

 iffsliRoot=1;
 iffsliTop=2;
 iffsliProp=3;

 iffsizeUnknown=-1;

 iffcmdInit=0;
 iffcmdCleanup=1;
 iffcmdRead=2;
 iffcmdWrite=3;
 iffcmdSeek=4;
 iffcmdEntry=5;
 iffcmdExit=6;
 iffcmdPurgelci=7;

END IFFParseD.noimp
