2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 /*****************************************************************************
14 #include <libraries/commodities.h>
15 #include <proto/exec.h>
16 #include <proto/commodities.h>
18 AROS_LH3(VOID
, InsertCxObj
,
22 AROS_LHA(CxObj
*, headObj
, A0
),
23 AROS_LHA(CxObj
*, co
, A1
),
24 AROS_LHA(CxObj
*, pred
, A2
),
28 struct Library
*, CxBase
, 16, Commodities
)
32 Insert commodity object 'co' into the list of object connected to
33 'headObj' after the object 'pred'.
37 headObj - poiter to a list of objects to which 'co' shall be inserted
38 co - commodity object to be inserted (may be NULL)
39 pred - the object 'co' shall be inserted after (may be NULL)
43 If 'headObj' is NULL, the object 'co' and all objects connected to it
44 are deleted. If 'co' is NULL and 'headObj' is a valid object, the
45 latter's accumulated error will be adjusted to incorporate
46 COERR_NULLATTACH. If 'pred' is NULL, the object will be inserted first
57 CxObjError(), ClearCxObjError()
63 ******************************************************************************/
77 headObj
->co_Error
|= COERR_NULLATTACH
;
82 ObtainSemaphore(&GPB(CxBase
)->cx_SignalSemaphore
);
84 Insert((struct List
*)&headObj
->co_ObjList
, &co
->co_Node
, &pred
->co_Node
);
85 co
->co_Flags
|= COF_VALID
;
87 ReleaseSemaphore(&GPB(CxBase
)->cx_SignalSemaphore
);