[Contents] [index] [Help] [Retrace] [browse <] [Browse >]

A custom cxobject has the power to directly manipulate the cxmessages that
travel around the Commodities network.  One way is to directly change
values in the corresponding input event.  Another way is to redirect (or
dispose of) the CxMessages.

    void DivertCxMsg ( CxMsg *cxm, CxObj *headobj, CxObj *retobj );
    void RouteCxMsg  ( CxMsg *cxm, CxObj *co );
    void DisposeCxMsg( CxMsg *cxm );

divertcxmsg() and routecxmsg() dictate where the cxmessage will go next.
Conceptually, DivertCxMsg() is analogous to a subroutine in a program; the
CxMessage will travel down the personal list of a cxobject (headobj in the
prototype) until it gets to the end of that list.  It then returns and
visits the CxObject that follows the return CxObject (the return CxObject
in the prototype above is retobj).  RouteCxMsg() is analogous to a goto in
a program; it has no CxObject to return to.

disposecxmsg() removes a cxmessage from the network and releases its
resources.  The translate cxobject uses this function to remove a
CxMessage.

The example Divert.c shows how to use divertcxmsg() as well as a
signal cxobject.

     divert.c