Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / commodities / setcxobjpri.c
blobbdd71dce952e49537c76b1cf7fac1d53b53d6517
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 /*****************************************************************************
11 NAME */
12 #include "cxintern.h"
13 #include <proto/commodities.h>
15 AROS_LH2I(LONG, SetCxObjPri,
17 /* SYNOPSIS */
19 AROS_LHA(CxObj *, co, A0),
20 AROS_LHA(LONG, pri, D0),
22 /* LOCATION */
24 struct Library *, CxBase, 13, Commodities)
26 /* FUNCTION
28 Set the priority of the commodity object 'co'.
30 INPUTS
32 co -- the commodity object the priority of which to change (may be
33 NULL)
34 pri -- the new priority to give the object (priorities range from
35 -128 to 127, a value of 0 is normal)
37 RESULT
39 The old priority, that is the priority of the object prior to this
40 operation.
42 NOTES
44 EXAMPLE
46 BUGS
48 When using this function, the object is NOT repositioned according to
49 the priority given. To achive this, remove the object from the commodity
50 hierarchy using RemoveCxObj(), use SetCxPri() and reinsert it with
51 EnqueueCxObj().
53 SEE ALSO
55 EnqueueCxObj()
57 INTERNALS
59 HISTORY
61 ******************************************************************************/
64 AROS_LIBFUNC_INIT
66 UBYTE oldPri;
68 if (co == NULL)
70 return 0;
73 oldPri = co->co_Node.ln_Pri;
74 co->co_Node.ln_Pri = pri;
76 return oldPri;
78 AROS_LIBFUNC_EXIT
79 } /* SetCxObjPri */