Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / commodities / cxintern.h
blobe6110fbccedc18fb09611ed4f70228d9ed6c01b2
1 /*
2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
10 #ifndef COMMODITIES_BASE_H
11 #define COMMODITIES_BASE_H
13 #define COF_VALID (1<<0) /* Object is inserted in a commodity list */
15 #define cxm_MaxLevel 32 /* Maximum routing level */
17 enum { CX_OBJECT, CX_MESSAGE, CX_INPUTEVENT };
18 enum { CXM_SINGLE, CXM_DOUBLE };
20 #define AROS_ALMOST_COMPATIBLE
21 #include <exec/lists.h>
23 #include <exec/types.h>
24 #include <exec/io.h>
25 #include <exec/nodes.h>
27 #include <exec/ports.h>
28 #include <exec/libraries.h>
29 #include <exec/interrupts.h>
30 #include <exec/semaphores.h>
31 #include <devices/inputevent.h>
32 #include <devices/timer.h>
33 #include <libraries/commodities.h>
34 #include <dos/dos.h>
35 #ifndef AROS_LIBCALL_H
36 # include <aros/libcall.h>
37 #endif
38 #ifndef PROTO_EXEC_H
39 # include <proto/exec.h>
40 #endif
42 /* Note that this is structurally the same as the BrokerCopy
43 * in commodities.h and make sure to keep it so as
44 * GetBrokerList() currently depends on this. */
45 struct BrokerExt
47 char bext_Name[CBD_NAMELEN];
48 char bext_Title[CBD_TITLELEN];
49 char bext_Descr[CBD_DESCRLEN];
50 struct Task *bext_Task;
51 struct MsgPort *bext_MsgPort;
54 struct SendExt
56 struct MsgPort *sext_MsgPort;
57 ULONG sext_ID;
60 struct SignalExt
62 struct Task *sixt_Task;
63 UBYTE sixt_SigBit;
66 struct CustomExt
68 VOID (*cext_Action)(VOID);
69 ULONG cext_ID;
73 typedef struct cx_Object
75 struct Node co_Node;
76 UBYTE co_Flags;
77 UBYTE co_Error;
78 struct MinList co_ObjList;
80 union
82 ULONG co_DebugID;
83 ULONG co_TypeFilter;
84 struct InputEvent *co_IE; /* Translate */
85 IX *co_FilterIX;
86 struct BrokerExt *co_BExt;
87 struct SendExt *co_SendExt;
88 struct SignalExt *co_SignalExt;
89 struct CustomExt *co_CustomExt;
90 } co_Ext;
91 } CxObj;
93 typedef struct cx_Message
95 struct Message cxm_Message;
96 CxObj *cxm_Routing; /* Next destination */
97 LONG cxm_ID;
98 UBYTE cxm_Type;
99 UBYTE cxm_Level;
100 CxObj *cxm_retObj[cxm_MaxLevel];
101 struct InputEvent *cxm_Data;
102 } CxMsg;
105 struct GeneratedInputEvent
107 struct InputEvent ie;
108 struct MinNode node;
111 struct CommoditiesBase
113 struct Library cx_Lib;
115 struct Library *cx_TimerBase;
117 struct IOStdReq cx_IORequest; /* To set up input handler */
118 struct Interrupt cx_Interrupt; /* Input handler */
119 struct MsgPort cx_InputMP; /* Reply port for input.device */
120 struct List cx_BrokerList;
121 struct List cx_MessageList;
122 struct List cx_GeneratedInputEvents;
123 struct SignalSemaphore cx_SignalSemaphore;
124 struct InputEvent *cx_IEvents;
125 struct InputEvent **cx_EventExtra; /* Only for bookkeeping
126 purposes */
127 struct MsgPort cx_MsgPort;
128 BOOL cx_Running; /* Is the input handler
129 installed? */
130 struct timerequest cx_TimerIO; /* For timer.device... */
131 struct MsgPort cx_TimerMP; /* ... communication */
134 /* Extra prototypes */
136 BOOL SetupIHandler(struct CommoditiesBase *CxBase);
137 VOID FreeCxStructure(APTR obj, int type, struct Library *CxBase);
138 APTR AllocCxStructure(LONG type, LONG objtype, struct Library *CxBase);
139 ULONG CheckStatus(CxObj *broker, ULONG command, struct Library *CxBase);
142 /* Locate library bases */
144 #ifdef TimerBase
145 #undef TimerBase
146 #endif
148 #define TimerBase ((struct CommoditiesBase *)CxBase)->cx_TimerBase
150 #define ROUTECxMsg(msg, obj) msg->cxm_Routing = obj
151 #define CXOBJType(co) (co->co_Node.ln_Type)
153 #define GPB(x) ((struct CommoditiesBase *)x)
155 #ifndef __MORPHOS__
156 #define dprintf bug
157 #endif
159 #endif /* COMMODITIES_BASE_H */