X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=madtty%2Fmadtty.c;h=959204d9f0a5d17e52ba5354812cef062ef7ba04;hb=880886ae6dca338d2d57e4b85cf984f4022ec520;hp=8fbc4695cd3e533868807926db7f59535c10f090;hpb=d0e48d929c19d39c4a13e57e0f8a8dd6194d6dde;p=apps%2Fmadtty.git diff --git a/madtty/madtty.c b/madtty/madtty.c index 8fbc469..959204d 100644 --- a/madtty/madtty.c +++ b/madtty/madtty.c @@ -27,9 +27,7 @@ #include #include "madtty.h" -#include "roteprivate.h" - -#define ROTE_VT_UPDATE_ITERATIONS 5 +#include "madtty_priv.h" RoteTerm *rote_vt_create(int rows, int cols) { @@ -118,9 +116,10 @@ void rote_vt_draw(RoteTerm *rt, WINDOW *win, int srow, int scol, void (*cur_set_attr)(WINDOW*,unsigned char)) { int i, j; - rote_vt_update(rt); - if (!cur_set_attr) cur_set_attr = default_cur_set_attr; + if (!cur_set_attr) + cur_set_attr = default_cur_set_attr; + for (i = 0; i < rt->rows; i++) { wmove(win, srow + i, scol); for (j = 0; j < rt->cols; j++) { @@ -235,29 +234,6 @@ void rote_vt_forsake_child(RoteTerm *rt) rt->childpid = 0; } -void rote_vt_update(RoteTerm *rt) -{ - char buf[512]; - int nbread; - int n = ROTE_VT_UPDATE_ITERATIONS; - - while (n--) { /* iterate at most ROVE_VT_UPDATE_ITERATIONS times. - * As Phil Endecott pointed out, if we don't restrict this, - * a program that floods the terminal with output - * could cause this loop to iterate forever, never - * being able to catch up. So we'll rely on the client - * calling rote_vt_update often, as the documentation - * recommends :-) */ - - nbread = rote_vt_read(rt, buf, sizeof(buf)); - if (nbread <= 0) - return; - - /* inject the data into the terminal */ - rote_vt_inject(rt, buf, nbread); - } -} - int rote_vt_read(RoteTerm *rt, char *buf, int buflen) { if (rt->pty < 0) {