Files @ b4a9c41d70da
Branch filter:

Location: CSY/reowolf/pseudo_socket.h

MH
Initial casting implementation

Explicit casts can be performed with the syntax 'cast<type>(input)'
and implicit casts can be performed with the syntax 'cast(input)'
where the output type is determined by inference.

To prevent casting shenanigans we only allow casting of primitive
types and of types to themselves (essentially creating a copy).
1
2
3
4
5
6
7
8
#include <sys/socket.h> // defines {sockaddr, socklen_t}

int rw_socket(int domain, int type, int protocol);
int rw_connect(int fd, const struct sockaddr *address, socklen_t address_len);
int rw_bind(int socket, const struct sockaddr *address, socklen_t address_len);
int rw_close(int fd);
ssize_t rw_send(int fd, const void * message, size_t length, int flags);
ssize_t rw_recv(int fd, void * buffer, size_t length, int flags);