2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
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>
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>
35 #ifndef AROS_LIBCALL_H
36 # include <aros/libcall.h>
39 # include <proto/exec.h>
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. */
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
;
56 struct MsgPort
*sext_MsgPort
;
62 struct Task
*sixt_Task
;
68 VOID (*cext_Action
)(VOID
);
73 typedef struct cx_Object
78 struct MinList co_ObjList
;
84 struct InputEvent
*co_IE
; /* Translate */
86 struct BrokerExt
*co_BExt
;
87 struct SendExt
*co_SendExt
;
88 struct SignalExt
*co_SignalExt
;
89 struct CustomExt
*co_CustomExt
;
93 typedef struct cx_Message
95 struct Message cxm_Message
;
96 CxObj
*cxm_Routing
; /* Next destination */
100 CxObj
*cxm_retObj
[cxm_MaxLevel
];
101 struct InputEvent
*cxm_Data
;
105 struct GeneratedInputEvent
107 struct InputEvent ie
;
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
127 struct MsgPort cx_MsgPort
;
128 BOOL cx_Running
; /* Is the input handler
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 */
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)
159 #endif /* COMMODITIES_BASE_H */