split out winsize from sys_ioctl header
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/termios.h.html
|
||||
#
|
||||
# This type is split out to include it in the following headers:
|
||||
# - sys/ioctl.h (Non-POSIX)
|
||||
# - termios.h (POSIX, where it should be defined)
|
||||
include_guard = "_RELIBC_BITS_WINSIZE_H"
|
||||
language = "C"
|
||||
style = "Tag"
|
||||
no_includes = true
|
||||
cpp_compat = true
|
||||
|
||||
[export]
|
||||
include = ["winsize"]
|
||||
@@ -0,0 +1,16 @@
|
||||
use crate::platform::types::c_ushort;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct winsize {
|
||||
ws_row: c_ushort,
|
||||
ws_col: c_ushort,
|
||||
ws_xpixel: c_ushort,
|
||||
ws_ypixel: c_ushort,
|
||||
}
|
||||
|
||||
impl winsize {
|
||||
pub fn get_row_col(&self) -> (c_ushort, c_ushort) {
|
||||
(self.ws_row, self.ws_col)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user