Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / hidds / parallel / parallel_stubs.c
blob4c8798f85c9503f84e791a24b7be8205d38d357c
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Stubs for Parallel and ParallelUnit class
6 Lang: english
7 */
9 #ifndef AROS_USE_OOP
10 # define AROS_USE_OOP
11 #endif
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>
21 #include <oop/oop.h>
22 #include <hidd/parallel.h>
24 //#include "parallel_intern.h"
26 #undef SDEBUG
27 #undef DEBUG
28 #define DEBUG 0
29 #include <aros/debug.h>
31 #undef OOPBase
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
48 #endif
50 /***************************************************************/
52 OOP_Object * HIDD_Parallel_NewUnit(OOP_Object *obj, ULONG unitnum)
54 STATIC_MID;
55 struct pHidd_Parallel_NewUnit p, *msg = &p;
57 if(!mid) mid = OOP_GetMethodID(IID_Hidd_Parallel, moHidd_Parallel_NewUnit);
59 p.mID = mid;
60 p.unitnum = unitnum;
62 return((OOP_Object *) OOP_DoMethod(obj, (OOP_Msg) msg));
64 /***************************************************************/
66 VOID HIDD_Parallel_DisposeUnit(OOP_Object *obj, OOP_Object *unit)
68 STATIC_MID;
69 struct pHidd_Parallel_DisposeUnit p, *msg = &p;
71 if(!mid) mid = OOP_GetMethodID(IID_Hidd_Parallel, moHidd_Parallel_DisposeUnit);
73 p.mID = mid;
74 p.unit = unit;
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)
86 STATIC_MID;
87 struct pHidd_ParallelUnit_Init p, *msg = &p;
89 if(!mid) mid = OOP_GetMethodID(IID_Hidd_ParallelUnit, moHidd_ParallelUnit_Init);
91 p.mID = mid;
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)
103 STATIC_MID;
104 struct pHidd_ParallelUnit_Write p, *msg = &p;
106 if(!mid) mid = OOP_GetMethodID(IID_Hidd_ParallelUnit, moHidd_ParallelUnit_Write);
108 p.mID = mid;
109 p.Length = length;
110 p.Outbuffer = data;
112 return ((ULONG) OOP_DoMethod(obj, (OOP_Msg) msg));
115 /***************************************************************/
117 VOID HIDD_ParallelUnit_Start (OOP_Object *obj)
119 STATIC_MID;
120 struct pHidd_ParallelUnit_Start p, *msg = &p;
122 if(!mid) mid = OOP_GetMethodID(IID_Hidd_ParallelUnit, moHidd_ParallelUnit_Start);
124 p.mID = mid;
126 ((VOID)OOP_DoMethod(obj, (OOP_Msg) msg));
129 /***************************************************************/
131 VOID HIDD_ParallelUnit_Stop (OOP_Object *obj)
133 STATIC_MID;
134 struct pHidd_ParallelUnit_Stop p, *msg = &p;
136 if(!mid) mid = OOP_GetMethodID(IID_Hidd_ParallelUnit, moHidd_ParallelUnit_Stop);
138 p.mID = mid;
140 ((VOID) OOP_DoMethod(obj, (OOP_Msg) msg));
143 /***************************************************************/
145 UWORD HIDD_ParallelUnit_GetStatus(OOP_Object *obj)
147 STATIC_MID;
148 struct pHidd_ParallelUnit_GetStatus p, *msg = &p;
150 if (!mid) mid = OOP_GetMethodID(IID_Hidd_ParallelUnit, moHidd_ParallelUnit_GetStatus);
152 p.mID = mid;
154 return ((UWORD)OOP_DoMethod(obj, (OOP_Msg) msg));