diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/tctl/tctl.c | 16 | ||||
| -rw-r--r-- | lib/tctl/tctl.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/tctl/tctl.c b/lib/tctl/tctl.c index d54f2dd..3bdc2fd 100644 --- a/lib/tctl/tctl.c +++ b/lib/tctl/tctl.c @@ -9,6 +9,22 @@ #define ICANON 000002 #define ECHO 000010 + +window_size_t tctl_get_fd_window_size(int fd) +{ + window_size_t ws; + ioctl(fd, GET_WIN_SIZE, &ws); + return ws; +} + + +void tctl_set_fd_window_size(int fd, window_size_t size) +{ + ioctl(fd, SET_WIN_SIZE, &size); +} + + + window_size_t tctl_get_window_size() { window_size_t ws; diff --git a/lib/tctl/tctl.h b/lib/tctl/tctl.h index d16c9eb..a650626 100644 --- a/lib/tctl/tctl.h +++ b/lib/tctl/tctl.h @@ -19,6 +19,8 @@ typedef struct { window_size_t tctl_get_window_size(); void tctl_set_window_size(window_size_t size); +window_size_t tctl_get_fd_window_size(int fd); +void tctl_set_fd_window_size(int fd, window_size_t size); int isatty(); int tcgetattr(int fd, termios_t *termios); void tcsetattr(int fd, termios_t *termios); |