diff options
Diffstat (limited to 'src/libsympathy.c')
-rw-r--r-- | src/libsympathy.c | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/src/libsympathy.c b/src/libsympathy.c index 7e6d78b..989b664 100644 --- a/src/libsympathy.c +++ b/src/libsympathy.c @@ -11,6 +11,9 @@ static char rcsid[] = /* * $Log$ + * Revision 1.16 2008/02/13 09:12:21 james + * *** empty log message *** + * * Revision 1.15 2008/02/13 01:08:18 james * *** empty log message *** * @@ -66,12 +69,12 @@ static char rcsid[] = void testy (void) { + fd_set rfd; struct termios raw = { 0 }; ANSI a = { 0 }; Context c; #if 0 - fd_set rfd; int fd; char c; @@ -81,15 +84,18 @@ testy (void) int i; #endif - + ansi_reset (&a); - c.t = tty_new_test (); + c.t = ptty_open (NULL, NULL); c.v = vt102_new (); + c.h = history_new (200); + c.l = NULL; - a.terminal=terminal_open(0,1); + terminal_register_handlers (); + a.terminal = terminal_open (0, 1); FD_ZERO (&rfd); @@ -97,33 +103,21 @@ testy (void) { struct timeval tv = { 0, 100000 }; - FD_SET (t->fd, &rfd); - FD_SET (a.fd, &rfd); - select (t->fd + 1, &rfd, NULL, NULL, &tv); -#if 0 - if (FD_ISSET (a.fd, &rfd)) - { - } -#endif + FD_SET (c.t->rfd, &rfd); + FD_SET (a.terminal->rfd, &rfd); - switch (ansi_dispatch (&a, v, t)) - { - case -1: - break; - case 1: - ansi_getsize (&a); - ansi_reset (&a); - ansi_draw (&a, &v->crt); - break; - } + select (FD_SETSIZE, &rfd, NULL, NULL, &tv); - if (FD_ISSET (t->fd, &rfd)) + ansi_dispatch (&a, &c); + + if (FD_ISSET (c.t->rfd, &rfd)) { - if (vt102_dispatch_one (v, t, h)) + if (vt102_dispatch (&c)) break; } +#if 0 if (had_winch) { had_winch = 0; @@ -131,8 +125,10 @@ testy (void) ansi_reset (&a); ansi_draw (&a, &v->crt); } - ansi_draw (&a, &v->crt); +#endif + //FIXME history + ansi_draw (&a, &c.v->crt); } - tcsetattr (0, TCSANOW, &old); - printf ("QUAT\n"); + + terminal_atexit (); } |