Updated PCI IDs to latest snapshot.
[tangerine.git] / arch / all-unix / hidd / unixio / unixio_stubs.c
blob70df7272e38e2843e23902f466adc34f9b412e81
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Unix filedescriptor/socket IO
6 Lang: english
7 */
9 #include <exec/execbase.h>
10 #include <hidd/unixio.h>
11 #include <oop/oop.h>
12 #include <proto/oop.h>
13 #include <aros/debug.h>
15 /************
16 ** Stubs **
17 ************/
19 #define OOPBase (OOP_OCLASS(o)->OOPBasePtr)
21 IPTR Hidd_UnixIO_Wait(HIDD *o, ULONG fd, ULONG mode, APTR callback, APTR callbackdata, struct ExecBase * SysBase)
23 static OOP_MethodID mid;
24 struct uioMsg p, *msg = &p;
26 if (!mid)
27 mid = OOP_GetMethodID(IID_Hidd_UnixIO, moHidd_UnixIO_Wait);
29 p.um_MethodID = mid;
30 p.um_Filedesc = fd;
31 p.um_Mode = mode;
32 p.um_CallBack = callback;
33 p.um_CallBackData = callbackdata;
35 return OOP_DoMethod((OOP_Object *)o, (OOP_Msg)msg);
38 IPTR Hidd_UnixIO_AsyncIO(HIDD *o, ULONG fd, ULONG fd_type, struct MsgPort * port, ULONG mode, struct ExecBase * SysBase)
40 static OOP_MethodID mid;
41 struct uioMsgAsyncIO p, *msg = &p;
43 if (!mid)
44 mid = OOP_GetMethodID(IID_Hidd_UnixIO, moHidd_UnixIO_AsyncIO);
46 p.um_MethodID = mid;
47 p.um_Filedesc = fd;
48 p.um_Filedesc_Type = fd_type;
49 p.um_ReplyPort = port;
50 p.um_Mode = mode;
52 return OOP_DoMethod((OOP_Object *)o, (OOP_Msg)msg);
56 VOID Hidd_UnixIO_AbortAsyncIO(HIDD *o, ULONG fd, struct ExecBase * SysBase)
58 static OOP_MethodID mid;
59 struct uioMsgAbortAsyncIO p, *msg = &p;
61 if (!mid)
62 mid = OOP_GetMethodID(IID_Hidd_UnixIO, moHidd_UnixIO_AbortAsyncIO);
64 p.um_MethodID = mid;
65 p.um_Filedesc = fd;
67 OOP_DoMethod((OOP_Object *)o, (OOP_Msg)msg);
70 int Hidd_UnixIO_OpenFile(HIDD *o, const char *filename, int flags, int mode, int *errno_ptr)
72 static OOP_MethodID mid;
73 struct uioMsgOpenFile p, *msg = &p;
75 if (!mid)
76 mid = OOP_GetMethodID(IID_Hidd_UnixIO, moHidd_UnixIO_OpenFile);
78 p.um_MethodID = mid;
79 p.um_FileName = (STRPTR)filename;
80 p.um_Flags = (STACKULONG)flags;
81 p.um_Mode = (STACKULONG)mode;
82 p.um_ErrNoPtr = errno_ptr;
84 return (int)OOP_DoMethod((OOP_Object *)o, (OOP_Msg)msg);
87 VOID Hidd_UnixIO_CloseFile(HIDD *o, int fd, int *errno_ptr)
89 static OOP_MethodID mid;
90 struct uioMsgCloseFile p, *msg = &p;
92 if (!mid)
93 mid = OOP_GetMethodID(IID_Hidd_UnixIO, moHidd_UnixIO_CloseFile);
95 p.um_MethodID = mid;
96 p.um_FD = (APTR)fd;
97 p.um_ErrNoPtr = errno_ptr;
99 OOP_DoMethod((OOP_Object *)o, (OOP_Msg)msg);
102 int Hidd_UnixIO_ReadFile(HIDD *o, int fd, void *buffer, int count, int *errno_ptr)
104 static OOP_MethodID mid;
105 struct uioMsgReadFile p, *msg = &p;
107 if (!mid)
108 mid = OOP_GetMethodID(IID_Hidd_UnixIO, moHidd_UnixIO_ReadFile);
110 p.um_MethodID = mid;
111 p.um_FD = (APTR)fd;
112 p.um_Buffer = (APTR)buffer;
113 p.um_Count = (STACKULONG)count;
114 p.um_ErrNoPtr = errno_ptr;
116 return (int)OOP_DoMethod((OOP_Object *)o, (OOP_Msg)msg);
119 int Hidd_UnixIO_WriteFile(HIDD *o, int fd, const void *buffer, int count, int *errno_ptr)
121 static OOP_MethodID mid;
122 struct uioMsgWriteFile p, *msg = &p;
124 if (!mid)
125 mid = OOP_GetMethodID(IID_Hidd_UnixIO, moHidd_UnixIO_WriteFile);
127 p.um_MethodID = mid;
128 p.um_FD = (APTR)fd;
129 p.um_Buffer = (APTR)buffer;
130 p.um_Count = (STACKULONG)count;
131 p.um_ErrNoPtr = errno_ptr;
133 return (int)OOP_DoMethod((OOP_Object *)o, (OOP_Msg)msg);
136 int Hidd_UnixIO_IOControlFile(HIDD *o, int fd, int request, void *param, int *errno_ptr)
138 static OOP_MethodID mid;
139 struct uioMsgIOControlFile p, *msg = &p;
141 if (!mid)
142 mid = OOP_GetMethodID(IID_Hidd_UnixIO, moHidd_UnixIO_IOControlFile);
144 p.um_MethodID = mid;
145 p.um_FD = (APTR)fd;
146 p.um_Request = (STACKULONG)request;
147 p.um_Param = (APTR)param;
148 p.um_ErrNoPtr = errno_ptr;
150 return (int)OOP_DoMethod((OOP_Object *)o, (OOP_Msg)msg);
153 /* The below function is just a hack to avoid
154 name conflicts inside intuition_driver.c
157 #undef OOPBase
159 HIDD *New_UnixIO(struct Library *OOPBase, struct ExecBase * SysBase)
161 struct TagItem tags[] = {{ TAG_END, 0 }};
163 return (HIDD)OOP_NewObject (NULL, CLID_Hidd_UnixIO, (struct TagItem *)tags);