Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / commodities / activatecxobj.c
bloba158af9e9c9f62336a3f973e9b1231574b2d003e
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 /*****************************************************************************
11 NAME */
13 #define DEBUG 0
14 #include <aros/debug.h>
16 #include "cxintern.h"
17 #include <libraries/commodities.h>
18 #include <proto/commodities.h>
20 AROS_LH2(LONG, ActivateCxObj,
22 /* SYNOPSIS */
24 AROS_LHA(CxObj *, co, A0),
25 AROS_LHA(LONG, true, D0),
27 /* LOCATION */
29 struct Library *, CxBase, 7, Commodities)
31 /* FUNCTION
33 Activates/deactivates a given commodity object. (An inactive object
34 doesn't perform its function on its input - it just passes it on to
35 the next object.) The activation depends on the value of 'true'; if
36 it's TRUE the object is activated, if it's FALSE it's deactivated.
37 All objects are created in the active state except for brokers;
38 remember to activate your broker when you have linked your other
39 objects to it.
41 INPUTS
43 co - a pointer to a commodity object
44 true - boolean telling whether the object should be activated or
45 deactivated
47 RESULT
49 The activation state of the object prior to the operation. (0 is
50 also returned if 'co' was NULL.)
52 NOTES
54 EXAMPLE
56 BUGS
58 SEE ALSO
60 CxBroker()
62 INTERNALS
64 HISTORY
66 ******************************************************************************/
69 AROS_LIBFUNC_INIT
71 LONG temp;
73 D(bug("Enter ActivateCxObj(cxobj = %p, true = %d)\n", co, true));
75 if (co == NULL)
77 return 0;
80 temp = (co->co_Flags & COF_ACTIVE);
82 if (true)
84 co->co_Flags |= COF_ACTIVE;
86 else
88 co->co_Flags &= ~COF_ACTIVE;
91 if (co->co_Node.ln_Type == CX_BROKER)
93 BrokerCommand(NULL, CXCMD_LIST_CHG);
96 return temp;
98 AROS_LIBFUNC_EXIT
99 } /* ActivateCxObject */