AcessNative - Adding network support
[tpg/acess2.git] / AcessNative / acesskernel_src / net_wrap.c
1 /*
2  * Acess2 Native Kernel
3  * - Acess kernel emulation on another OS using SDL and UDP
4  *
5  * net.c
6  * - Networking
7  */
8 #include <unistd.h>
9 #include <logdebug.h>
10 #include "net_wrap.h"
11
12 typedef struct sNetSocket       tNetSocket;
13
14 struct sNetSocket
15 {
16         tNetSocket      *Next;
17          int    FD;
18 };
19
20 tNetSocket      *gNet_Wrap_FirstSocket;
21 tNetSocket      *gNet_Wrap_LastSocket;
22
23 // === CODE ===
24 void *Net_Wrap_ConnectTcp(void *Node, short SrcPort, short DstPtr, int Type, const void *Addr)
25 {
26         return NULL;
27 }
28
29 size_t Net_Wrap_ReadSocket(void *Handle, size_t Bytes, void *Dest)
30 {
31         tNetSocket      *hdl = Handle;
32         if(!hdl)        return -1;
33         return read(hdl->FD, Dest, Bytes);
34 }
35
36 size_t Net_Wrap_WriteSocket(void *Handle, size_t Bytes, const void *Dest)
37 {
38         tNetSocket      *hdl = Handle;
39         if(!hdl)        return -1;
40         return write(hdl->FD, Dest, Bytes);
41 }
42
43 void Net_Wrap_CloseSocket(void *Handle)
44 {
45         // TODO
46 }
47

UCC git Repository :: git.ucc.asn.au