Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / commodities / insertcxobj.c
blobed973ba83065e9a996839a29a3fe1a901d0bc215
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 <libraries/commodities.h>
15 #include <proto/exec.h>
16 #include <proto/commodities.h>
18 AROS_LH3(VOID, InsertCxObj,
20 /* SYNOPSIS */
22 AROS_LHA(CxObj *, headObj, A0),
23 AROS_LHA(CxObj *, co , A1),
24 AROS_LHA(CxObj *, pred , A2),
26 /* LOCATION */
28 struct Library *, CxBase, 16, Commodities)
30 /* FUNCTION
32 Insert commodity object 'co' into the list of object connected to
33 'headObj' after the object 'pred'.
35 INPUTS
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)
41 RESULT
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
47 in the list.
49 NOTES
51 EXAMPLE
53 BUGS
55 SEE ALSO
57 CxObjError(), ClearCxObjError()
59 INTERNALS
61 HISTORY
63 ******************************************************************************/
66 AROS_LIBFUNC_INIT
68 if (headObj == NULL)
70 DeleteCxObjAll(co);
72 return;
75 if (co == NULL)
77 headObj->co_Error |= COERR_NULLATTACH;
79 return;
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);
89 AROS_LIBFUNC_EXIT
90 } /* InsertCxObj */