Removed empty line causing all LVOs to be wrong as
[cake.git] / test / unixio.c
blobc79c8fc366da234e9a09812b8b2e8664fb7d3d16
1 #include <hidd/unixio.h>
2 #include <proto/exec.h>
3 #include <proto/dos.h>
4 #include <proto/oop.h>
5 #include <oop/oop.h>
7 struct Library * OOPBase;
8 struct DosLibrary * DOSBase;
10 int main (int argc, char ** argv)
12 APTR hidd;
13 LONG ret;
14 int fd;
15 IPTR vpa[1];
16 struct TagItem tags[ ]= {{TAG_DONE, 0UL}};
17 struct uioMsg uio_msg;
19 OOPBase = OpenLibrary ("oop.library", 0);
21 if (!OOPBase)
23 vpa[0] = (IPTR)"oop.library";
24 VPrintf("Can't open library \"%s\"\n", vpa);
25 return 10;
28 DOSBase = (struct DosLibrary *) OpenLibrary (DOSNAME, 0);
30 if (!DOSBase)
32 CloseLibrary (OOPBase);
34 vpa[0] = (IPTR)DOSNAME;
35 VPrintf("Can't open library \"%s\"\n", vpa);
36 return 10;
40 hidd = OOP_NewObject (NULL, CLID_Hidd_UnixIO, tags);
42 if (!hidd)
44 CloseLibrary (OOPBase);
45 CloseLibrary ((struct Library *)DOSBase);
47 vpa[0] = (IPTR)CLID_Hidd_UnixIO;
48 VPrintf("Need \"%s\" class\n", vpa);
49 return 10;
52 fd = 0;
53 uio_msg.um_MethodID = OOP_GetMethodID(IID_Hidd_UnixIO, moHidd_UnixIO_Wait);
54 uio_msg.um_Filedesc = fd;
55 uio_msg.um_Mode = vHidd_UnixIO_Read;
56 ret = OOP_DoMethod(hidd, (OOP_Msg)&uio_msg);
58 vpa[0] = ret;
59 VPrintf ("return code = %ld\n", vpa);
61 OOP_DisposeObject (hidd);
63 CloseLibrary ((struct Library *)DOSBase);
64 CloseLibrary (OOPBase);
66 return 0;