DEFINITION MODULE CommoditiesD; (*$ Implementation:=FALSE *)
(* 06-Jun-1993/bp *)

FROM SYSTEM IMPORT ADDRESS,BITSET;

FROM InputEvent IMPORT
 Qualifiers, QualifierSet, Class;

FROM ExecD IMPORT
 MsgPortPtr;

CONST
 commoditiesName="commodities.library";

TYPE
  CxObjPtr; (* system private! *)
  CxMsgPtr;

CONST
 cbdNamelen=24;
 cbdTitlelen=40;
 cbdDescrlen=40;

 cberrOk=0;
 cberrSyserr=1;
 cberrDup=2;
 cberrVersion=3;

 nbVersion=5;

TYPE
 UniqueFlags=(
  unique,notify,uf2,uf3,uf4,uf5,uf6,uf7
  ,uf8,uf9,uf10,uf11,uf12,uf13,uf14,uf15
 );
 UniqueFlagSet=SET OF UniqueFlags;

 NewBrokerFlags=(
  nbf0,nbf1,showHide,nbf3,nbf4,nbf5,nbf6,nbf7
  ,nbf8,nbf9,nbf10,nbf11,nbf12,nbf13,nbf14,nbf15
 );
 NewBrokerFlagSet=SET OF NewBrokerFlags;

 NewBroker=RECORD
  version:SHORTINT;
  name:ADDRESS;
  title:ADDRESS;
  descr:ADDRESS;
  unique:UniqueFlagSet;
  flags:NewBrokerFlagSet;
  pri:SHORTINT;
  port:MsgPortPtr;
  reservedChannel:CARDINAL;
 END;
 NewBrokerPtr=POINTER TO NewBroker;

CONST
 nbuDuplicate=UniqueFlagSet{};
 nbuUnique=UniqueFlagSet{unique};
 nbuNotify=UniqueFlagSet{notify};

 cofShowHide=NewBrokerFlagSet{showHide};

TYPE
 PFL=POINTER TO PROCEDURE():LONGINT;

CONST
 cxInvalid=0;
 cxFilter=1;
 cxTypefilter=2;
 cxSend=3;
 cxSignal=4;
 cxTranslate=5;
 cxBroker=6;
 cxDebug=7;
 cxCustom=8;
 cxZero=9;

 cxmUnique=16;
 cxmIevent=32;
 cxmCommand=64;

 cxcmdDisable=15;
 cxcmdEnable=17;
 cxcmdAppear=19;
 cxcmdDisappear=21;
 cxcmdKill=23;
 cxcmdUnique=25;
 cxcmdListChg=27;

 cmdeOk=0;
 cmdeNobroker=-1;
 cmdeNoport=-2;
 cmdeNomem=-3;

TYPE
 CoError=(
  isNull,nullAttach,badFilter,badType,ce4,ce5,ce6,ce7
  ,ce8,ce9,ce10,ce11,ce12,ce13,ce14,ce15,ce16
 );
 CoErrorSet=SET OF CoError;

CONST
 ixVersion=2;

TYPE
 InputXpression=RECORD
  version:SHORTCARD;
  class:Class;
  code:CARDINAL;
  codeMask:CARDINAL;
  qualifier:QualifierSet;
  qualMask:QualifierSet;
  qualSame:CARDINAL;
 END;
 IX=InputXpression;

 InputXpressionPtr=POINTER TO InputXpression;
 IXPtr=POINTER TO IX;

CONST
 ixsymShift=1;
 ixsymCaps=2;
 ixsymAlt=4;

 ixsymShiftmask=QualifierSet{lShift,rShift};
 ixsymCapsmask=ixsymShiftmask+QualifierSet{capsLock};
 ixsymAltmask=QualifierSet{lAlt,rAlt};

 ixNormalquals=QualifierSet{lShift..leftButton};

END CommoditiesD.noimp
