revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / commodities / divertcxmsg.c
blob0997cd47b2990c47a5c174e550db33c49ad33a93
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 /*****************************************************************************
11 NAME */
13 #include "cxintern.h"
14 #include <proto/commodities.h>
16 AROS_LH3I(VOID, DivertCxMsg,
18 /* SYNOPSIS */
20 AROS_LHA(CxMsg *, cxm , A0),
21 AROS_LHA(CxObj *, headObj , A1),
22 AROS_LHA(CxObj *, returnObj, A2),
24 /* LOCATION */
26 struct Library *, CxBase, 26, Commodities)
28 /* FUNCTION
30 Send the commodity message 'cxm' down the list of objects connected to
31 'headObj' and set the destination to 'returnObj'. This means that when
32 the message has travelled through the objects within the 'headObj' tree,
33 the _successor_ of returnObj will receive the message.
35 INPUTS
37 cxm -- the message to be diverted.
38 headObj -- the start object
39 returnObj -- the successor of this object will get the message after
40 travelling through 'headObj' and friends.
42 RESULT
44 NOTES
46 EXAMPLE
48 When a filter gets a message that matches with its description, it
49 sends the message down its list using:
51 DivertCxMsg(msg, filter, filter);
53 BUGS
55 SEE ALSO
57 RouteCxMsg()
59 INTERNALS
61 HISTORY
63 ******************************************************************************/
66 AROS_LIBFUNC_INIT
68 ROUTECxMsg(cxm, (CxObj *)GetHead(&headObj->co_ObjList));
70 if (cxm->cxm_Level >= cxm_MaxLevel)
72 return;
75 cxm->cxm_retObj[cxm->cxm_Level] = returnObj;
76 cxm->cxm_Level++;
78 AROS_LIBFUNC_EXIT
79 } /* DivertCxMsg */