aboutsummaryrefslogtreecommitdiffstats
path: root/src/tiocgwinsz.rs
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2023-12-27 09:52:27 -0800
committerRose Hogenson <rosehogenson@posteo.net>2023-12-27 09:52:27 -0800
commitc280882749e4126e8863e1e9869e16c5c46197a7 (patch)
tree365a9d7c9bd4da2469e797a383f84be0a1d17d92 /src/tiocgwinsz.rs
parentUse stdout to get terminal size. (diff)
downloadeditor-c280882749e4126e8863e1e9869e16c5c46197a7.tar.zst
Rename tiocgwinsz.rs to term.rs.
I will be putting more functionality in this file.
Diffstat (limited to 'src/tiocgwinsz.rs')
-rw-r--r--src/tiocgwinsz.rs18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/tiocgwinsz.rs b/src/tiocgwinsz.rs
deleted file mode 100644
index f8246fd..0000000
--- a/src/tiocgwinsz.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-use libc::{c_int, winsize};
-
-pub fn size() -> Option<winsize> {
- let mut window: winsize = winsize {
- ws_row: 0,
- ws_col: 0,
- ws_xpixel: 0,
- ws_ypixel: 0,
- };
- let result: c_int;
- unsafe {
- result = libc::ioctl(1, libc::TIOCGWINSZ, &mut window);
- }
- if result < 0 {
- return None;
- }
- return Some(window);
-}