2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Stubs for Parallel and ParallelUnit class
13 #include <aros/config.h>
14 #include <exec/types.h>
15 #include <exec/libraries.h>
17 #include <proto/oop.h>
19 #include <utility/tagitem.h>
22 #include <hidd/parallel.h>
24 //#include "parallel_intern.h"
29 #include <aros/debug.h>
32 #define OOPBase ((struct Library *)OOP_OCLASS(obj)->OOPBasePtr)
34 #define STATIC_MID static OOP_MethodID mid
36 /* A small utility function for using varargs when setting attrs */
38 #warning OOP_SetAttrsTags is defined in inline/oop.h
40 #ifndef OOP_SetAttrsTags
41 IPTR
OOP_SetAttrsTags(OOP_Object
*obj
, IPTR tag1
, ...)
43 AROS_SLOWSTACKTAGS_PRE(tag1
)
44 retval
= OOP_SetAttrs(obj
, AROS_SLOWSTACKTAGS_ARG(tag1
));
45 AROS_SLOWSTACKTAGS_POST
50 /***************************************************************/
52 OOP_Object
* HIDD_Parallel_NewUnit(OOP_Object
*obj
, ULONG unitnum
)
55 struct pHidd_Parallel_NewUnit p
, *msg
= &p
;
57 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_Parallel
, moHidd_Parallel_NewUnit
);
62 return((OOP_Object
*) OOP_DoMethod(obj
, (OOP_Msg
) msg
));
64 /***************************************************************/
66 VOID
HIDD_Parallel_DisposeUnit(OOP_Object
*obj
, OOP_Object
*unit
)
69 struct pHidd_Parallel_DisposeUnit p
, *msg
= &p
;
71 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_Parallel
, moHidd_Parallel_DisposeUnit
);
76 OOP_DoMethod(obj
, (OOP_Msg
) msg
);
82 /********************** Stubs for parallel unit **********************/
84 BOOL
HIDD_ParallelUnit_Init(OOP_Object
*obj
, VOID
* DataReceived
, VOID
* DataReceivedUserData
, VOID
* WriteData
, VOID
* WriteDataUserData
)
87 struct pHidd_ParallelUnit_Init p
, *msg
= &p
;
89 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_ParallelUnit
, moHidd_ParallelUnit_Init
);
92 p
.DataReceived
= DataReceived
;
93 p
.DataReceivedUserData
= DataReceivedUserData
;
94 p
.WriteData
= WriteData
;
95 p
.WriteDataUserData
= WriteDataUserData
;
97 return((BOOL
) OOP_DoMethod(obj
, (OOP_Msg
) msg
));
99 /***************************************************************/
101 ULONG
HIDD_ParallelUnit_Write (OOP_Object
*obj
, UBYTE
* data
, ULONG length
)
104 struct pHidd_ParallelUnit_Write p
, *msg
= &p
;
106 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_ParallelUnit
, moHidd_ParallelUnit_Write
);
112 return ((ULONG
) OOP_DoMethod(obj
, (OOP_Msg
) msg
));
115 /***************************************************************/
117 VOID
HIDD_ParallelUnit_Start (OOP_Object
*obj
)
120 struct pHidd_ParallelUnit_Start p
, *msg
= &p
;
122 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_ParallelUnit
, moHidd_ParallelUnit_Start
);
126 ((VOID
)OOP_DoMethod(obj
, (OOP_Msg
) msg
));
129 /***************************************************************/
131 VOID
HIDD_ParallelUnit_Stop (OOP_Object
*obj
)
134 struct pHidd_ParallelUnit_Stop p
, *msg
= &p
;
136 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_ParallelUnit
, moHidd_ParallelUnit_Stop
);
140 ((VOID
) OOP_DoMethod(obj
, (OOP_Msg
) msg
));
143 /***************************************************************/
145 UWORD
HIDD_ParallelUnit_GetStatus(OOP_Object
*obj
)
148 struct pHidd_ParallelUnit_GetStatus p
, *msg
= &p
;
150 if (!mid
) mid
= OOP_GetMethodID(IID_Hidd_ParallelUnit
, moHidd_ParallelUnit_GetStatus
);
154 return ((UWORD
)OOP_DoMethod(obj
, (OOP_Msg
) msg
));