Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / commodities / settranslate.c
bloba6e3329241f153ac1d746dd45a1a57e852114981
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 <exec/libraries.h>
16 #include <proto/exec.h>
18 AROS_LH2(VOID, SetTranslate,
20 /* SYNOPSIS */
22 AROS_LHA(CxObj * , translator, A0),
23 AROS_LHA(struct InputEvent *, events , A1),
25 /* LOCATION */
27 struct Library *, CxBase, 19, Commodities)
29 /* FUNCTION
31 Set translation (a list of input events) for a commodity translator
32 object.
34 INPUTS
36 translator -- the commodity translator the translation result of which
37 to set (may be NULL)
38 events -- the new input event list
40 RESULT
42 NOTES
44 If events is set to NULL, all commodity messages passed to the object
45 are swallowed. Neither commodities.library nor any other commodities
46 user will change your list of InputEvents; however, it will be used
47 asynchronously to the application program which means you shouldn't
48 in any way corrupt the chain.
50 EXAMPLE
52 BUGS
54 SEE ALSO
56 cx_lib/CxTranslate(), <devices/inputevent.h>
58 INTERNALS
60 HISTORY
62 ******************************************************************************/
65 AROS_LIBFUNC_INIT
67 if (translator == NULL)
69 return;
72 ObtainSemaphore(&GPB(CxBase)->cx_SignalSemaphore);
74 if (CXOBJType(translator) != CX_TRANSLATE)
76 translator->co_Error |= COERR_BADTYPE;
78 else
80 translator->co_Ext.co_IE = events;
83 ReleaseSemaphore(&GPB(CxBase)->cx_SignalSemaphore);
85 AROS_LIBFUNC_EXIT
86 } /* SetTranslate */