2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 /*****************************************************************************
14 #include <aros/debug.h>
15 #include <libraries/commodities.h>
16 #include <proto/exec.h>
18 #define DEBUG_BADFILTER(x) x;
20 AROS_LH2(VOID
, SetFilterIX
,
24 AROS_LHA(CxObj
*, filter
, A0
),
25 AROS_LHA(IX
* , ix
, A1
),
29 struct Library
*, CxBase
, 21, Commodities
)
33 Set the filter description by supplying an InputXpression.
37 filter -- the commodity filter object the attributes of which to set
39 ix -- InputXpression describing the filter
43 The internal error field will be updated (COERR_BADFILTER) depending on
44 whether the function succeeded or failed.
48 The first field in the IX structure must be set to IX_VERSION as
49 defined in <libraries/commodities.h>, to indicate which version of
50 the IX structure is used.
58 SetFilter(), CxObjError(), <libraries/commodities.h>
64 ******************************************************************************/
74 ObtainSemaphore(&GPB(CxBase
)->cx_SignalSemaphore
);
76 if (CXOBJType(filter
) == CX_FILTER
)
78 if (ix
->ix_Version
== IX_VERSION
)
80 CopyMem(ix
, filter
+ 1, sizeof(IX
));
81 filter
->co_Ext
.co_FilterIX
= (APTR
)(filter
+ 1);
82 filter
->co_Error
&= ~COERR_BADFILTER
;
86 DEBUG_BADFILTER(dprintf("SetFilterIX: ix_Version == %lu (should be %lu)!\n", ix
->ix_Version
, IX_VERSION
));
87 filter
->co_Error
|= COERR_BADFILTER
;
92 filter
->co_Error
|= COERR_BADTYPE
;
95 ReleaseSemaphore(&GPB(CxBase
)->cx_SignalSemaphore
);