Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / libs / commodities / setcxobjpri.c
blobde91a0bc1da708d80ed84ec380aa844d89a747f2
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 <proto/commodities.h>
17 AROS_LH2I(LONG, SetCxObjPri,
19 /* SYNOPSIS */
21 AROS_LHA(CxObj *, co, A0),
22 AROS_LHA(LONG, pri, D0),
24 /* LOCATION */
26 struct Library *, CxBase, 13, Commodities)
28 /* FUNCTION
30 Set the priority of the commodity object 'co'.
32 INPUTS
34 co -- the commodity object the priority of which to change (may be
35 NULL)
36 pri -- the new priority to give the object (priorities range from
37 -128 to 127, a value of 0 is normal)
39 RESULT
41 The old priority, that is the priority of the object prior to this
42 operation.
44 NOTES
46 EXAMPLE
48 BUGS
50 When using this function, the object is NOT repositioned according to
51 the priority given. To achive this, remove the object from the commodity
52 hierarchy using RemoveCxObj(), use SetCxPri() and reinsert it with
53 EnqueueCxObj().
55 SEE ALSO
57 EnqueueCxObj()
59 INTERNALS
61 HISTORY
63 ******************************************************************************/
66 AROS_LIBFUNC_INIT
68 UBYTE oldPri;
70 if (co == NULL)
72 return 0;
75 oldPri = co->co_Node.ln_Pri;
76 co->co_Node.ln_Pri = pri;
78 return oldPri;
80 AROS_LIBFUNC_EXIT
81 } /* SetCxObjPri */