2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 /*****************************************************************************
13 #define AROS_ALMOST_COMPATIBLE
16 #include <exec/memory.h>
17 #include <libraries/commodities.h>
18 #include <proto/exec.h>
19 #include <proto/commodities.h>
21 AROS_LH1(LONG
, CopyBrokerList
,
25 AROS_LHA(struct List
*, CopyofList
, A0
),
29 struct Library
*, CxBase
, 31, Commodities
)
33 Get a copy of the internal list of brokers.
37 CopyofList -- pointer to a list
41 The number of brokers in the list. The elements of the input list will
46 This function is present in AmigaOS too but undocumented.
58 ******************************************************************************/
64 struct BrokerCopy
*brokerCopy
;
67 FreeBrokerList(CopyofList
);
69 ObtainSemaphore(&GPB(CxBase
)->cx_SignalSemaphore
);
71 ForeachNode(&GPB(CxBase
)->cx_BrokerList
, broker
)
73 if (CxObjType(broker
) == CX_ZERO
)
78 brokerCopy
= AllocVec(sizeof(struct BrokerCopy
), MEMF_PUBLIC
| MEMF_CLEAR
);
80 if (brokerCopy
== NULL
)
85 /* Copy the broker name */
86 CopyMem(broker
->co_Ext
.co_BExt
, brokerCopy
->bc_Name
, sizeof(*broker
->co_Ext
.co_BExt
));
87 brokerCopy
->bc_Flags
= broker
->co_Flags
;
88 /* Point the node name to the broker name */
89 brokerCopy
->bc_Node
.ln_Name
= brokerCopy
->bc_Name
;
92 AddTail(CopyofList
, &brokerCopy
->bc_Node
);
96 ReleaseSemaphore(&GPB(CxBase
)->cx_SignalSemaphore
);
101 } /* CopyBrokerList */