relibc/header/bits_winsize/mod.rs
1use crate::platform::types::c_ushort;
2
3#[repr(C)]
4#[derive(Default)]
5pub struct winsize {
6 /// Rows, in characters.
7 ws_row: c_ushort,
8 /// Columns, in characters.
9 ws_col: c_ushort,
10 /// Non-POSIX, see <https://www.man7.org/linux/man-pages/man2/TIOCSWINSZ.2const.html>.
11 ///
12 /// Unused.
13 ws_xpixel: c_ushort,
14 /// Non-POSIX, see <https://www.man7.org/linux/man-pages/man2/TIOCSWINSZ.2const.html>.
15 ///
16 /// Unused.
17 ws_ypixel: c_ushort,
18}
19
20impl winsize {
21 /// Return the row and column in that order in a tuple.
22 pub fn get_row_col(&self) -> (c_ushort, c_ushort) {
23 (self.ws_row, self.ws_col)
24 }
25}