zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_net.h
Go to the documentation of this file.
1 #ifndef SDL_NET_H
2 #define SDL_NET_H
3 
4 #include <SDL/SDL_stdinc.h>
5 #include <netinet/in.h>
6 
7 struct IPaddress {
8  Uint32 host;
9  Uint16 port;
10 };
11 
12 inline Uint16 SDLNet_Read16(const void * const &area) {
13  return ntohs(*static_cast<const Uint16 *>(area));
14 }
15 
16 inline Uint32 SDLNet_Read32(const void * const &area) {
17  return ntohl(*static_cast<const Uint32 *>(area));
18 }
19 
20 inline void SDLNet_Write16(const Uint32 &value, void * const &area) {
21  *static_cast<Uint16 *>(area) = htons(value);
22 }
23 
24 inline void SDLNet_Write32(const Uint32 &value, void * const &area) {
25  *static_cast<Uint32 *>(area) = htonl(value);
26 }
27 
28 #endif
#define SDLNet_Write16(value, areap)
Definition: SDL_net.h:376
Uint32 host
Definition: SDL_net.h:91
#define SDLNet_Write32(value, areap)
Definition: SDL_net.h:377
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:145
#define SDLNet_Read32(areap)
Definition: SDL_net.h:381
Uint16 port
Definition: SDL_net.h:92
EGLSurface EGLint void ** value
Definition: eglext.h:301
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:137
#define SDLNet_Read16(areap)
Definition: SDL_net.h:380