diff options
author | james <> | 2008-02-13 18:05:06 +0000 |
---|---|---|
committer | james <> | 2008-02-13 18:05:06 +0000 |
commit | 7b7996c7bb4bd66f6262f4e721b6960d6b58b801 (patch) | |
tree | 9f5e12b05faf7fb66de0d20c05c0db4b804bb8b2 /apps/sympathyd.c | |
parent | 9644f7cf7d6949303984a058b9b3694c92ac9be5 (diff) | |
download | sympathy-7b7996c7bb4bd66f6262f4e721b6960d6b58b801.tar.gz sympathy-7b7996c7bb4bd66f6262f4e721b6960d6b58b801.tar.bz2 sympathy-7b7996c7bb4bd66f6262f4e721b6960d6b58b801.zip |
*** empty log message ***
Diffstat (limited to 'apps/sympathyd.c')
-rw-r--r-- | apps/sympathyd.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/apps/sympathyd.c b/apps/sympathyd.c index 820f4d9..2e45ed1 100644 --- a/apps/sympathyd.c +++ b/apps/sympathyd.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.5 2008/02/13 18:05:06 james + * *** empty log message *** + * * Revision 1.4 2008/02/13 17:21:55 james * *** empty log message *** * @@ -24,16 +27,18 @@ static char rcsid[] = "$Id$"; * */ -#include "sympathy.h" +#include <sympathy.h> -#include -void main (int argc,char *argv[]) +#include "client.h" +#include "clients.h" + +int main (int argc,char *argv[]) { - fd_set rfd, wfd; + fd_set rfds, wfds; ANSI a = { 0 }; Context c; Socket *s, *cs; - Client **clients; + Clients *clients; s = socket_listen ("socket"); @@ -55,34 +60,35 @@ void main (int argc,char *argv[]) struct timeval tv = { 0, 100000 }; - FD_ZERO (&rfd); - FD_ZERO (&wfd); + FD_ZERO (&rfds); + FD_ZERO (&wfds); - tty_pre_select (c.t, &rfd); - tty_pre_select (a.terminal, &rfd); + tty_pre_select (c.t, &rfds,&wfds); + tty_pre_select (a.terminal, &rfds,&wfds); - socket_pre_select (s, &rfd, &wfd); + socket_pre_select (s, &rfds, &wfds); - client_pre_select (clients); + clients_pre_select (clients,&rfds,&wfds); - select (FD_SETSIZE, &rfd, NULL, NULL, &tv); + select (FD_SETSIZE, &rfds, NULL, NULL, &tv); - cs = socket_post_select (s, &rfd, &wfd); + cs = socket_post_select (s, &rfds, &wfds); if (cs) { /*New client connexion */ - clients_new (clients, cs, c); + clients_new_client (clients, cs, &c); } - clients_post_select (clients, c, &rfds, &wfds); - if (FD_ISSET (c->t->rfd, &rfds)) + clients_post_select (clients, &c, &rfds, &wfds); + + if (FD_ISSET (c.t->rfd, &rfds)) { char buf[1024]; int red; - red = c->t->recv (c->t, buf, sizeof (buf)); + red = c.t->recv (c.t, buf, sizeof (buf)); if (red < 0) break; @@ -90,7 +96,7 @@ void main (int argc,char *argv[]) if (red) { clients_output (clients, buf, red); - vt102_parse (c, buf, red); + vt102_parse (&c, buf, red); } } |