---@meta posix.termio

---@class posix_termio_cc*
---@field [integer] integer

---@class posix_termio_attr*
---@field iflag integer
---@field oflag integer
---@field lflag integer
---@field cflag integer
---@field ispeed integer
---@field ospeed integer
---@field cc posix_termio_cc*

---@class posix_termio_winsize*
---@field row integer
---@field col integer
---@field xpixel integer
---@field ypixel integer

---@class posix_termio*
---@field version string
---@field TCSANOW integer
---@field TCSADRAIN integer
---@field TCSAFLUSH integer
---@field TCIFLUSH integer
---@field TCOFLUSH integer
---@field TCIOFLUSH integer
---@field TCOOFF integer
---@field TCOON integer
---@field TCIOFF integer
---@field TCION integer
---@field B0 integer
---@field B50 integer
---@field B75 integer
---@field B110 integer
---@field B134 integer
---@field B150 integer
---@field B200 integer
---@field B300 integer
---@field B600 integer
---@field B1200 integer
---@field B1800 integer
---@field B2400 integer
---@field B4800 integer
---@field B9600 integer
---@field B19200 integer
---@field B38400 integer
---@field B57600 integer
---@field B115200 integer
---@field CSIZE integer
---@field CS5 integer
---@field CS6 integer
---@field CS7 integer
---@field CS8 integer
---@field CSTOPB integer
---@field CREAD integer
---@field PARENB integer
---@field PARODD integer
---@field HUPCL integer
---@field CLOCAL integer
---@field CRTSCTS integer
---@field ISIG integer
---@field ICANON integer
---@field ECHO integer
---@field ECHOE integer
---@field ECHOK integer
---@field ECHONL integer
---@field NOFLSH integer
---@field IEXTEN integer
---@field TOSTOP integer
---@field INPCK integer
---@field IGNPAR integer
---@field PARMRK integer
---@field ISTRIP integer
---@field IXON integer
---@field IXOFF integer
---@field IXANY integer
---@field IGNBRK integer
---@field BRKINT integer
---@field INLCR integer
---@field IGNCR integer
---@field ICRNL integer
---@field IMAXBEL integer
---@field OPOST integer
---@field ONLCR integer
---@field OCRNL integer
---@field ONLRET integer
---@field OFILL integer
---@field OFDEL integer
---@field NLDLY integer
---@field NL0 integer
---@field NL1 integer
---@field CRDLY integer
---@field CR0 integer
---@field CR1 integer
---@field CR2 integer
---@field CR3 integer
---@field TABDLY integer
---@field TAB0 integer
---@field TAB1 integer
---@field TAB2 integer
---@field TAB3 integer
---@field BSDLY integer
---@field BS0 integer
---@field BS1 integer
---@field VTDLY integer
---@field VT0 integer
---@field VT1 integer
---@field FFDLY integer
---@field FF0 integer
---@field FF1 integer
---@field VINTR integer
---@field VQUIT integer
---@field VERASE integer
---@field VKILL integer
---@field VEOF integer
---@field VEOL integer
---@field VEOL2 integer
---@field VMIN integer
---@field VTIME integer
---@field VSTART integer
---@field VSTOP integer
---@field VSUSP integer
---@field CBAUD integer
---@field EXTA integer
---@field EXTB integer
---@field DEFECHO integer
---@field ECHOCTL integer
---@field ECHOPRT integer
---@field ECHOKE integer
---@field FLUSHO integer
---@field IUTF8 integer
---@field PENDIN integer
---@field LOBLK integer
---@field SWTCH integer
---@field VDISCARD integer
---@field VDSUSP integer
---@field VLNEXT integer
---@field VREPRINT integer
---@field VSTATUS integer
---@field VWERASE integer
---@type posix_termio*
local M = {}

---@param fd integer
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.tcdrain(fd) end

---@param fd integer
---@param action integer
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.tcflow(fd, action) end

---@param fd integer
---@param selector integer
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.tcflush(fd, selector) end

---@param fd integer
---@return posix_termio_attr*? attr
---@return string? errMsg
---@return integer? errno
function M.tcgetattr(fd) end

---@param fd integer
---@param duration? integer
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.tcsendbreak(fd, duration) end

---@param fd integer
---@param actions integer
---@param attr posix_termio_attr*
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.tcsetattr(fd, actions, attr) end

---@param fd integer
---@return posix_termio_winsize*? size
---@return string? errMsg
---@return integer? errno
function M.tcgetwinsize(fd) end

---@param fd integer
---@param size posix_termio_winsize*
---@return integer? ok
---@return string? errMsg
---@return integer? errno
function M.tcsetwinsize(fd, size) end

return M
