(C) 1998 AROS - The Amiga Research OS
NAME
()
SYNOPSIS
FUNCTION
INPUTS
RESULT
EXAMPLE
SEE ALSO
NOTES
BUGS
INTERNALS
HISTORY
#include "cxintern.h"#include
#include
#include
#include
#include
#define DEBUG 1#include
static void ProduceEvent(CxMsg *, struct CommoditiesBase *CxBase);static void DebugFunc(CxMsg *, CxObj *, struct CommoditiesBase *CxBase);static void TransFunc(CxMsg *, CxObj *, struct CommoditiesBase *CxBase);static void SendFunc(CxMsg *, CxObj *, struct CommoditiesBase *CxBase);static BOOL CopyInputEvent(struct InputEvent *from, struct InputEvent *to, struct CommoditiesBase *CxBase);AROS_UFH2(struct InputEvent *, CxTree, AROS_UFHA(struct InputEvent * , events , A0), AROS_UFHA(struct CommoditiesBase *, CxBase , A6) ){ CxObj *co; CxMsg *tempMsg, *msg; struct InputEvent *tempEvent, *nextEvent; if(events == NULL) return NULL; if(IsListEmpty(&CxBase->cx_BrokerList)) return events; ObtainSemaphore(&CxBase->cx_SignalSemaphore); /* Take care of the processed input events */ for(tempEvent = CxBase->cx_IEvents; tempEvent != NULL;) { nextEvent = tempEvent->ie_NextEvent; FreeMem(tempEvent, sizeof(struct InputEvent)); tempEvent = nextEvent; } CxBase->cx_IEvents = NULL; CxBase->cx_EventExtra = NULL; /* Free all the replied messages */ while((tempMsg = (CxMsg *)GetMsg(&CxBase->cx_MsgPort)) != NULL) FreeCxStructure(tempMsg, CX_MESSAGE, (struct Library *)CxBase); /* Route all messages to the first broker */ tempMsg = (CxMsg *)CxBase->cx_MessageList.lh_Head; co = (CxObj *)GetHead(&CxBase->cx_BrokerList); while(tempMsg != NULL) { tempMsg->cxm_Routing = co; tempMsg = (CxMsg *)tempMsg->cxm_Message.mn_Node.ln_Succ; } AddIEvents(events); /* Add the new events (incapsulated in commodtity messages) to the message list. */