aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-13 18:42:19 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-13 18:42:19 +0100
commit02b2a3ae1e4767174d57013c4f881b5b05567bd6 (patch)
treea3792922decb948f47d4b1fd682fada5522561a9 /FICS
parentf55ee28cf57a2152b494222fb350a227f45cb091 (diff)
Reformatted functions
Diffstat (limited to 'FICS')
-rw-r--r--FICS/network.c71
1 files changed, 36 insertions, 35 deletions
diff --git a/FICS/network.c b/FICS/network.c
index bec92ac..6315948 100644
--- a/FICS/network.c
+++ b/FICS/network.c
@@ -440,48 +440,50 @@ PUBLIC int net_init(int port)
return 0;
}
-PUBLIC void net_close(void)
+PUBLIC void
+net_close(void)
{
- int i;
- for (i = 0; i < no_file; i++) {
- if (con[i].status != NETSTAT_EMPTY)
- net_close_connection(con[i].fd);
- }
+ for (int i = 0; i < no_file; i++) {
+ if (con[i].status != NETSTAT_EMPTY)
+ net_close_connection(con[i].fd);
+ }
}
-PUBLIC void net_close_connection(int fd)
+PUBLIC void
+net_close_connection(int fd)
{
- if (con[fd].status == NETSTAT_CONNECTED)
- net_flush_connection(fd);
- if (!remConnection(fd)) {
- if (fd > 2)
- close(fd);
- }
+ if (con[fd].status == NETSTAT_CONNECTED)
+ net_flush_connection(fd);
+ if (!remConnection(fd)) {
+ if (fd > 2)
+ close(fd);
+ }
}
-PUBLIC void turn_echo_on(int fd)
+PUBLIC void
+turn_echo_on(int fd)
{
- static unsigned char wont_echo[] = {IAC, WONT, TELOPT_ECHO, '\0'};
-
- send(fd, (char *) wont_echo, strlen((char *) wont_echo), 0);
+ static unsigned char wont_echo[] = { IAC, WONT, TELOPT_ECHO, '\0' };
+ send(fd, (char *) wont_echo, strlen((char *) wont_echo), 0);
}
-PUBLIC void turn_echo_off(int fd)
+PUBLIC void
+turn_echo_off(int fd)
{
- static unsigned char will_echo[] = {IAC, WILL, TELOPT_ECHO, '\0'};
-
- send(fd, (char *) will_echo, strlen((char *) will_echo), 0);
+ static unsigned char will_echo[] = { IAC, WILL, TELOPT_ECHO, '\0' };
+ send(fd, (char *) will_echo, strlen((char *) will_echo), 0);
}
-PUBLIC unsigned int net_connected_host(int fd)
+PUBLIC unsigned int
+net_connected_host(int fd)
{
- int which;
+ int which;
- if ((which = findConnection(fd)) < 0) {
- fprintf(stderr, "FICS: FD not in connection table!\n");
- return -1;
- }
- return con[which].fromHost;
+ if ((which = findConnection(fd)) < 0) {
+ fprintf(stderr, "FICS: FD not in connection table!\n");
+ return -1;
+ }
+ return con[which].fromHost;
}
PUBLIC void
@@ -553,13 +555,12 @@ ngc2(char *com, int timeout)
}
}
-PUBLIC int net_consize(void)
+PUBLIC int
+net_consize(void)
{
- int i, total;
-
- total = sizeof(con);
- for (i=0; i < no_file; i++)
- total += con[i].sndbufsize;
+ int total = sizeof con;
- return(total);
+ for (int i = 0; i < no_file; i++)
+ total += con[i].sndbufsize;
+ return total;
}