diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-05-04 21:52:59 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-05-04 21:52:59 -0400 |
commit | 6ceb606a155d2950ca7e5fd2165997246494caeb (patch) | |
tree | 5bcbb1082aba7e35a8130b66423f9eadc56d3866 /src/pty-unix.c | |
parent | d78ae64f0682a4aef09e9ff77e8748af9b2380b9 (diff) | |
download | runes-6ceb606a155d2950ca7e5fd2165997246494caeb.tar.gz runes-6ceb606a155d2950ca7e5fd2165997246494caeb.zip |
more refactoring
Diffstat (limited to 'src/pty-unix.c')
-rw-r--r-- | src/pty-unix.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/pty-unix.c b/src/pty-unix.c index 59636e7..82a3809 100644 --- a/src/pty-unix.c +++ b/src/pty-unix.c @@ -101,16 +101,16 @@ void runes_pty_backend_set_window_size(RunesTerm *t) size.ws_row = t->scr.grid->max.row; size.ws_col = t->scr.grid->max.col; - size.ws_xpixel = t->xpixel; - size.ws_ypixel = t->ypixel; + size.ws_xpixel = t->display.xpixel; + size.ws_ypixel = t->display.ypixel; ioctl(t->pty.master, TIOCSWINSZ, &size); } void runes_pty_backend_write(RunesTerm *t, char *buf, size_t len) { write(t->pty.master, buf, len); - if (t->w.row_visible_offset != 0) { - t->w.row_visible_offset = 0; + if (t->display.row_visible_offset != 0) { + t->display.row_visible_offset = 0; t->scr.dirty = 1; runes_window_backend_request_flush(t); } @@ -134,23 +134,25 @@ static void runes_pty_backend_read(uv_work_t *req) { RunesLoopData *data = req->data; RunesTerm *t = data->t; + RunesPtyBackend *pty = &t->pty; runes_window_backend_request_flush(t); - t->readlen = read( - t->pty.master, t->readbuf + t->remaininglen, - RUNES_READ_BUFFER_LENGTH - t->remaininglen); + pty->readlen = read( + pty->master, pty->readbuf + pty->remaininglen, + RUNES_READ_BUFFER_LENGTH - pty->remaininglen); } static void runes_pty_backend_got_data(uv_work_t *req, int status) { RunesLoopData *data = req->data; RunesTerm *t = data->t; + RunesPtyBackend *pty = &t->pty; UNUSED(status); - if (t->readlen > 0) { + if (pty->readlen > 0) { runes_screen_process_string( - t, t->readbuf, t->readlen + t->remaininglen); + t, pty->readbuf, pty->readlen + pty->remaininglen); uv_queue_work( t->loop, req, runes_pty_backend_read, runes_pty_backend_got_data); } |