# std/termios

Theme:

- Manual
- Standard library
- Index
- Compiler docs
- Fusion docs
- devel, stable

Search:
Source Edit

# Imports

posix

# Types

    Cflag = cuint

  Source Edit

    IOctl_WinSize = object
      ws_row*, ws_col*, ws_xpixel*, ws_ypixel*: cushort

  Source Edit

    Speed = cuint

  Source Edit

    Termios {.importc: "struct termios", header: "<termios.h>".} = object
      c_iflag*: Cflag
      c_oflag*: Cflag
      c_cflag*: Cflag
      c_lflag*: Cflag
      c_cc*: array[NCCS, cuchar]

  Source Edit

# Vars

    B0 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B50 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B75 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B110 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B134 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B150 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B200 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B300 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B600 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B1200 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B1800 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B2400 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B4800 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B9600 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B19200 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B38400 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B57600 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B115200 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B230400 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B460800 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B500000 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B576000 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B921600 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B1000000 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B1152000 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B1500000 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B2000000 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B2500000 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B3000000 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B3500000 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    B4000000 {.importc, header: "<termios.h>".}: Speed

  Source Edit

    BRKINT {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    BS0 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    BS1 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    BSDLY {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CLOCAL {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CR0 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CR1 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CR2 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CR3 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CRDLY {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CREAD {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CS5 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CS6 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CS7 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CS8 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CSIZE {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    CSTOPB {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    ECHO {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    ECHOE {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    ECHOK {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    ECHONL {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    EXTA {.importc, header: "<termios.h>".}: Speed

  Source Edit

    EXTB {.importc, header: "<termios.h>".}: Speed

  Source Edit

    FF0 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    FF1 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    FFDLY {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    HUPCL {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    ICANON {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    ICRNL {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    IEXTEN {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    IGNBRK {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    IGNCR {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    IGNPAR {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    INLCR {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    INPCK {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    ISIG {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    ISTRIP {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    IUCLC {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    IXANY {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    IXOFF {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    IXON {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    NL0 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    NL1 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    NLDLY {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    NOFLSH {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    OCRNL {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    OFDEL {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    OFILL {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    ONLCR {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    ONLRET {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    ONOCR {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    OPOST {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    PARENB {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    PARMRK {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    PARODD {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    TAB0 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    TAB1 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    TAB2 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    TAB3 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    TABDLY {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    TCIFLUSH {.importc, header: "<termios.h>".}: cint

  Source Edit

    TCIOFF {.importc, header: "<termios.h>".}: cint

  Source Edit

    TCIOFLUSH {.importc, header: "<termios.h>".}: cint

  Source Edit

    TCION {.importc, header: "<termios.h>".}: cint

  Source Edit

    TCOFLUSH {.importc, header: "<termios.h>".}: cint

  Source Edit

    TCOOFF {.importc, header: "<termios.h>".}: cint

  Source Edit

    TCOON {.importc, header: "<termios.h>".}: cint

  Source Edit

    TCSADRAIN {.importc, header: "<termios.h>".}: cint

  Source Edit

    TCSAFLUSH {.importc, header: "<termios.h>".}: cint

  Source Edit

    TCSANOW {.importc, header: "<termios.h>".}: cint

  Source Edit

    TIOCGWINSZ {.importc, header: "<sys/ioctl.h>".}: culong

  Source Edit

    TOSTOP {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    VEOF {.importc, header: "<termios.h>".}: cint

  Source Edit

    VEOL {.importc, header: "<termios.h>".}: cint

  Source Edit

    VERASE {.importc, header: "<termios.h>".}: cint

  Source Edit

    VINTR {.importc, header: "<termios.h>".}: cint

  Source Edit

    VKILL {.importc, header: "<termios.h>".}: cint

  Source Edit

    VMIN {.importc, header: "<termios.h>".}: cint

  Source Edit

    VQUIT {.importc, header: "<termios.h>".}: cint

  Source Edit

    VSTART {.importc, header: "<termios.h>".}: cint

  Source Edit

    VSTOP {.importc, header: "<termios.h>".}: cint

  Source Edit

    VSUSP {.importc, header: "<termios.h>".}: cint

  Source Edit

    VT0 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    VT1 {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    VTDLY {.importc, header: "<termios.h>".}: Cflag

  Source Edit

    VTIME {.importc, header: "<termios.h>".}: cint

  Source Edit

# Consts

    NCCS = 32

  Source Edit

# Procs

    proc cfGetIspeed(termios: ptr Termios): Speed {.importc: "cfgetispeed",
        header: "<termios.h>", ...raises: [], tags: [], forbids: [].}

  Source Edit

    proc cfGetOspeed(termios: ptr Termios): Speed {.importc: "cfgetospeed",
        header: "<termios.h>", ...raises: [], tags: [], forbids: [].}

  Source Edit

    proc cfSetIspeed(termios: ptr Termios; speed: Speed): cint {.
        importc: "cfsetispeed", header: "<termios.h>", ...raises: [], tags: [],
        forbids: [].}

  Source Edit

    proc cfSetOspeed(termios: ptr Termios; speed: Speed): cint {.
        importc: "cfsetospeed", header: "<termios.h>", ...raises: [], tags: [],
        forbids: [].}

  Source Edit

    proc ioctl(fd: cint; request: culong; reply: ptr IOctl_WinSize): int {.
        importc: "ioctl", header: "<stdio.h>", varargs, ...raises: [], tags: [],
        forbids: [].}

  Source Edit

    proc tcDrain(fd: cint): cint {.importc: "tcdrain", header: "<termios.h>",
                                   ...raises: [], tags: [], forbids: [].}

  Source Edit

    proc tcFlow(fd: cint; action: cint): cint {.importc: "tcflow",
        header: "<termios.h>", ...raises: [], tags: [], forbids: [].}

  Source Edit

    proc tcFlush(fd: cint; queue_selector: cint): cint {.importc: "tcflush",
        header: "<termios.h>", ...raises: [], tags: [], forbids: [].}

  Source Edit

    proc tcGetAttr(fd: cint; termios: ptr Termios): cint {.importc: "tcgetattr",
        header: "<termios.h>", ...raises: [], tags: [], forbids: [].}

  Source Edit

    proc tcSendBreak(fd: cint; duration: cint): cint {.importc: "tcsendbreak",
        header: "<termios.h>", ...raises: [], tags: [], forbids: [].}

  Source Edit

    proc tcSetAttr(fd: cint; optional_actions: cint; termios: ptr Termios): cint {.
        importc: "tcsetattr", header: "<termios.h>", ...raises: [], tags: [],
        forbids: [].}

  Source Edit

# Templates

    template cceq(val, c): untyped

  Source Edit