diff options
Diffstat (limited to 'src/socket.h')
-rw-r--r-- | src/socket.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/socket.h b/src/socket.h index 787b7a5..368c2b6 100644 --- a/src/socket.h +++ b/src/socket.h | |||
@@ -41,8 +41,6 @@ int sock_open(void); | |||
41 | int sock_close(void); | 41 | int sock_close(void); |
42 | void sock_destroy(p_sock ps); | 42 | void sock_destroy(p_sock ps); |
43 | void sock_shutdown(p_sock ps, int how); | 43 | void sock_shutdown(p_sock ps, int how); |
44 | int sock_send(p_sock ps, const char *data, size_t count, size_t *sent, p_tm tm); | ||
45 | int sock_recv(p_sock ps, char *data, size_t count, size_t *got, p_tm tm); | ||
46 | int sock_sendto(p_sock ps, const char *data, size_t count, | 44 | int sock_sendto(p_sock ps, const char *data, size_t count, |
47 | size_t *sent, SA *addr, socklen_t addr_len, p_tm tm); | 45 | size_t *sent, SA *addr, socklen_t addr_len, p_tm tm); |
48 | int sock_recvfrom(p_sock ps, char *data, size_t count, | 46 | int sock_recvfrom(p_sock ps, char *data, size_t count, |
@@ -51,15 +49,22 @@ void sock_setnonblocking(p_sock ps); | |||
51 | void sock_setblocking(p_sock ps); | 49 | void sock_setblocking(p_sock ps); |
52 | int sock_select(int n, fd_set *rfds, fd_set *wfds, fd_set *efds, p_tm tm); | 50 | int sock_select(int n, fd_set *rfds, fd_set *wfds, fd_set *efds, p_tm tm); |
53 | 51 | ||
54 | const char *sock_connect(p_sock ps, SA *addr, socklen_t addr_len, p_tm tm); | 52 | int sock_connect(p_sock ps, SA *addr, socklen_t addr_len, p_tm tm); |
55 | const char *sock_create(p_sock ps, int domain, int type, int protocol); | 53 | int sock_create(p_sock ps, int domain, int type, int protocol); |
56 | const char *sock_bind(p_sock ps, SA *addr, socklen_t addr_len); | 54 | int sock_bind(p_sock ps, SA *addr, socklen_t addr_len); |
57 | const char *sock_listen(p_sock ps, int backlog); | 55 | int sock_listen(p_sock ps, int backlog); |
58 | const char *sock_accept(p_sock ps, p_sock pa, SA *addr, | 56 | int sock_accept(p_sock ps, p_sock pa, SA *addr, socklen_t *addr_len, p_tm tm); |
59 | socklen_t *addr_len, p_tm tm); | 57 | |
58 | const char *sock_hoststrerror(int err); | ||
59 | const char *sock_strerror(int err); | ||
60 | |||
61 | /* these are perfect to use with the io abstraction module | ||
62 | and the buffered input module */ | ||
63 | int sock_send(p_sock ps, const char *data, size_t count, size_t *sent, p_tm tm); | ||
64 | int sock_recv(p_sock ps, char *data, size_t count, size_t *got, p_tm tm); | ||
65 | const char *sock_ioerror(p_sock ps, int err); | ||
60 | 66 | ||
61 | const char *sock_geterr(p_sock ps, int code); | 67 | int sock_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp); |
62 | const char *sock_hoststrerror(void); | 68 | int sock_gethostbyname(const char *addr, struct hostent **hp); |
63 | const char *sock_strerror(void); | ||
64 | 69 | ||
65 | #endif /* SOCK_H */ | 70 | #endif /* SOCK_H */ |