/* Async functions for M68_AREXX_CED Interface */ /* Sat Jul 14 00:32:02 1990 v0.4 J.Fox */ PARSE ARG 1 Port2Open ErrCount = 0 MaxCount = 0 EndCount = 0 if( SHOW('Ports','rexx_ced') = 0) then exit(25) /* CygnusEd -- AREXX port - is CygnusEd active ? */ if( OPENPORT(Port2Open) = '0000 0000'X) then exit(100) loop: call WAITPKT Port2Open packet = GETPKT(Port2Open) if(packet = '0000 0000'X) then Signal loop Directv = UPPER(GETARG(packet,0)) Select when (Directv = "M68REPORT") then Signal GetM68Data /* M68REPORT */ when (Directv = "NEXTERR") then Signal NextErr when (Directv = "PREVERR") then Signal Preverr when (Directv = "M68END") then do EndCount = MaxCount REPLY(packet,0) Signal loop end when (Directv = "QUIT") then Signal OKBye otherwise do say 'QueueM68 received an UNKNOWN_COMMAND' eror = 20 Signal Bye end end GetM68Data: ErrCount = GETARG(packet,1) MaxCount = ErrCount M68.1.ErrCount = GETARG(packet,2) /* SrcFile */ M68.2.ErrCount = GETARG(packet,3) /* ErrLine */ M68.3.ErrCount = GETARG(packet,4) /* ErrMsg */ M68.4.ErrCount = GETARG(packet,5) /* Error # */ /* M68.5.ErrCount = GETARG(packet,6) Pass Number */ call REPLY(packet,0) if( ErrCount = 1 ) then do ADDRESS 'rexx_ced' 'CedToFront' EndCount = 0 which = 1 Signal TellCED end else Signal loop NextErr: if( (which+1) > MaxCount) then do if(MaxCount = EndCount) then call REPLY(packet,10) /* NO MORE */ else call REPLY(packet,5) /* NO MORE YET */ Signal loop end else do call REPLY(packet,0) which = which + 1 Signal TellCED end PrevErr: if (which = 1) then do call REPLY(packet,5) Signal loop end else do call REPLY(packet,0) which = which - 1 Signal TellCED end TellCED: ADDRESS 'AREXX' 'Rexx:m68CedIface.rexx' M68.1.which M68.2.which M68.4.which M68.3.which Signal loop OKBye: eror = 0 Bye: call CLOSEPORT Port2Open exit(eror)