59 #define SDL_NET_MAJOR_VERSION 2
60 #define SDL_NET_MINOR_VERSION 0
61 #define SDL_NET_PATCHLEVEL 0
66 #define SDL_NET_VERSION(X) \
68 (X)->major = SDL_NET_MAJOR_VERSION; \
69 (X)->minor = SDL_NET_MINOR_VERSION; \
70 (X)->patch = SDL_NET_PATCHLEVEL; \
102 #define INADDR_ANY 0x00000000
105 #define INADDR_NONE 0xFFFFFFFF
107 #ifndef INADDR_LOOPBACK
108 #define INADDR_LOOPBACK 0x7f000001
110 #ifndef INADDR_BROADCAST
111 #define INADDR_BROADCAST 0xFFFFFFFF
178 #define SDLNET_MAX_UDPCHANNELS 32
180 #define SDLNET_MAX_UDPADDRESSES 4
347 #define SDLNet_SocketReady(sock) _SDLNet_SocketReady((SDLNet_GenericSocket)(sock))
368 #if defined(sparc) || defined(mips) || defined(__arm__)
369 #define SDL_DATA_ALIGNED 1
371 #ifndef SDL_DATA_ALIGNED
372 #define SDL_DATA_ALIGNED 0
376 #define SDLNet_Write16(value, areap) _SDLNet_Write16(value, areap)
377 #define SDLNet_Write32(value, areap) _SDLNet_Write32(value, areap)
380 #define SDLNet_Read16(areap) _SDLNet_Read16(areap)
381 #define SDLNet_Read32(areap) _SDLNet_Read32(areap)
383 #if !defined(WITHOUT_SDL) && !SDL_DATA_ALIGNED
410 area[0] = (value >> 8) & 0xFF;
411 area[1] = value & 0xFF;
417 area[0] = (value >> 24) & 0xFF;
418 area[1] = (value >> 16) & 0xFF;
419 area[2] = (value >> 8) & 0xFF;
420 area[3] = value & 0xFF;
DECLSPEC int SDLCALL SDLNet_TCP_Send(TCPsocket sock, const void *data, int len)
DECLSPEC void SDLCALL SDLNet_SetError(const char *fmt,...)
DECLSPEC int SDLCALL SDLNet_CheckSockets(SDLNet_SocketSet set, Uint32 timeout)
static __inline__ Uint32 _SDLNet_Read32(const void *areap)
DECLSPEC int SDLCALL SDLNet_DelSocket(SDLNet_SocketSet set, SDLNet_GenericSocket sock)
struct _UDPsocket * UDPsocket
static __inline__ int SDLNet_UDP_DelSocket(SDLNet_SocketSet set, UDPsocket sock)
DECLSPEC UDPsocket SDLCALL SDLNet_UDP_Open(Uint16 port)
DECLSPEC void SDLCALL SDLNet_FreeSocketSet(SDLNet_SocketSet set)
DECLSPEC int SDLCALL SDLNet_Init(void)
static __inline__ Uint16 _SDLNet_Read16(const void *areap)
struct _SDLNet_GenericSocket * SDLNet_GenericSocket
static __inline__ void _SDLNet_Write32(Uint32 value, void *areap)
DECLSPEC TCPsocket SDLCALL SDLNet_TCP_Accept(TCPsocket server)
DECLSPEC UDPpacket *SDLCALL SDLNet_AllocPacket(int size)
DECLSPEC int SDLCALL SDLNet_AddSocket(SDLNet_SocketSet set, SDLNet_GenericSocket sock)
DECLSPEC const SDLNet_version *SDLCALL SDLNet_Linked_Version(void)
DECLSPEC IPaddress *SDLCALL SDLNet_TCP_GetPeerAddress(TCPsocket sock)
DECLSPEC void SDLCALL SDLNet_UDP_Unbind(UDPsocket sock, int channel)
static UDPpacket ** packets
uint32_t Uint32
An unsigned 32-bit integer type.
static __inline__ int SDLNet_TCP_AddSocket(SDLNet_SocketSet set, TCPsocket sock)
static __inline__ int SDLNet_UDP_AddSocket(SDLNet_SocketSet set, UDPsocket sock)
struct _SDLNet_SocketSet * SDLNet_SocketSet
static __inline__ void _SDLNet_Write16(Uint16 value, void *areap)
Information the version of SDL in use.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
DECLSPEC int SDLCALL SDLNet_UDP_SendV(UDPsocket sock, UDPpacket **packets, int npackets)
DECLSPEC void SDLCALL SDLNet_FreePacketV(UDPpacket **packetV)
DECLSPEC UDPpacket **SDLCALL SDLNet_AllocPacketV(int howmany, int size)
GLuint GLuint64EXT address
static __inline__ int _SDLNet_SocketReady(SDLNet_GenericSocket sock)
DECLSPEC TCPsocket SDLCALL SDLNet_TCP_Open(IPaddress *ip)
DECLSPEC const char *SDLCALL SDLNet_ResolveIP(const IPaddress *ip)
DECLSPEC void SDLCALL SDLNet_Quit(void)
GLbitfield GLuint64 timeout
DECLSPEC int SDLCALL SDLNet_UDP_Send(UDPsocket sock, int channel, UDPpacket *packet)
DECLSPEC int SDLCALL SDLNet_GetLocalAddresses(IPaddress *addresses, int maxcount)
DECLSPEC int SDLCALL SDLNet_ResolveHost(IPaddress *address, const char *host, Uint16 port)
DECLSPEC void SDLCALL SDLNet_UDP_SetPacketLoss(UDPsocket sock, int percent)
DECLSPEC void SDLCALL SDLNet_FreePacket(UDPpacket *packet)
SDL_version SDLNet_version
EGLSurface EGLint void ** value
struct _TCPsocket * TCPsocket
uint8_t Uint8
An unsigned 8-bit integer type.
static __inline__ int SDLNet_TCP_DelSocket(SDLNet_SocketSet set, TCPsocket sock)
DECLSPEC void SDLCALL SDLNet_UDP_Close(UDPsocket sock)
DECLSPEC int SDLCALL SDLNet_UDP_Bind(UDPsocket sock, int channel, const IPaddress *address)
DECLSPEC IPaddress *SDLCALL SDLNet_UDP_GetPeerAddress(UDPsocket sock, int channel)
DECLSPEC SDLNet_SocketSet SDLCALL SDLNet_AllocSocketSet(int maxsockets)
DECLSPEC int SDLCALL SDLNet_TCP_Recv(TCPsocket sock, void *data, int maxlen)
uint16_t Uint16
An unsigned 16-bit integer type.
DECLSPEC void SDLCALL SDLNet_TCP_Close(TCPsocket sock)
DECLSPEC const char *SDLCALL SDLNet_GetError(void)
DECLSPEC int SDLCALL SDLNet_ResizePacket(UDPpacket *packet, int newsize)
DECLSPEC int SDLCALL SDLNet_UDP_Recv(UDPsocket sock, UDPpacket *packet)
DECLSPEC int SDLCALL SDLNet_UDP_RecvV(UDPsocket sock, UDPpacket **packets)