diff options
Diffstat (limited to 'FICS')
| -rw-r--r-- | FICS/network.c | 11 | ||||
| -rw-r--r-- | FICS/network.h | 5 |
2 files changed, 10 insertions, 6 deletions
diff --git a/FICS/network.c b/FICS/network.c index 19c6f22..a530ce3 100644 --- a/FICS/network.c +++ b/FICS/network.c @@ -596,16 +596,19 @@ turn_echo_off(int fd) warn("%s: cannot send", __func__); } -PUBLIC unsigned int -net_connected_host(int fd) +PUBLIC bool +net_connected_host(int fd, unsigned int *fromHost) { int which; if ((which = findConnection(fd)) < 0) { fprintf(stderr, "FICS: FD not in connection table!\n"); - return -1; + *fromHost = 0; + return false; } - return con[which].fromHost; + + *fromHost = con[which].fromHost; + return true; } PUBLIC void diff --git a/FICS/network.h b/FICS/network.h index 2225734..f928255 100644 --- a/FICS/network.h +++ b/FICS/network.h @@ -26,6 +26,8 @@ #ifndef _NETWORK_H #define _NETWORK_H +#include <stdbool.h> + #include "command.h" /* For MAX_STRING_LENGTH */ #define NET_NETERROR 0 @@ -86,8 +88,7 @@ extern int net_consize(void); extern int net_init(int); extern int net_send_string(int, char *, int); extern int readline2(comstr_t *, int); -extern unsigned int - net_connected_host(int); +extern bool net_connected_host(int, unsigned int *); extern void net_close(void); extern void net_close_connection(int); extern void ngc2(comstr_t *, int); |
