aboutsummaryrefslogtreecommitdiffstats
path: root/apps/sympathyd.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/sympathyd.c')
-rw-r--r--apps/sympathyd.c42
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);
}
}