4 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
9 static char rcsid[] = "$Id$";
13 * Revision 1.4 2008/02/13 17:21:55 james
14 * *** empty log message ***
16 * Revision 1.3 2008/02/08 15:06:52 james
17 * *** empty log message ***
19 * Revision 1.2 2008/02/07 15:42:49 james
20 * *** empty log message ***
22 * Revision 1.1 2008/02/05 14:25:49 james
23 * *** empty log message ***
30 void main (int argc,char *argv[])
39 s = socket_listen ("socket");
41 c.t = ptty_open (NULL, NULL);
43 c.h = history_new (200);
44 c.l = file_log_new ("log");
46 terminal_register_handlers ();
47 a.terminal = terminal_open (0, 1);
49 ansi_reset (&a, NULL);
51 clients=clients_new();
55 struct timeval tv = { 0, 100000 };
61 tty_pre_select (c.t, &rfd);
62 tty_pre_select (a.terminal, &rfd);
64 socket_pre_select (s, &rfd, &wfd);
66 client_pre_select (clients);
68 select (FD_SETSIZE, &rfd, NULL, NULL, &tv);
70 cs = socket_post_select (s, &rfd, &wfd);
74 /*New client connexion */
75 clients_new (clients, cs, c);
78 clients_post_select (clients, c, &rfds, &wfds);
80 if (FD_ISSET (c->t->rfd, &rfds))
85 red = c->t->recv (c->t, buf, sizeof (buf));
92 clients_output (clients, buf, red);
93 vt102_parse (c, buf, red);
97 ansi_dispatch (&a, &c);
101 clients_shutdown (clients);
102 ansi_terminal_reset (&a);