raw

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2015 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CfMakeRaw

func CfMakeRaw(termios *Termios)

CfMakeRaw sets the flags stored in the termios structure to a state disabling all input and output processing, giving a “raw I/O path”.

From man cfmakeraw(3) on linux: termios_p->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); termios_p->c_oflag &= ~OPOST; termios_p->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); termios_p->c_cflag &= ~(CSIZE | PARENB); termios_p->c_cflag |= CS8;

func TcSetAttr

func TcSetAttr(fd uintptr, termios *Termios) error

TcSetAttr restores the terminal connected to the given file descriptor to a previous state.

Types

type Termios

type Termios struct {
	Iflag  uint32
	Oflag  uint32
	Cflag  uint32
	Lflag  uint32
	Cc     [20]byte
	Ispeed uint32
	Ospeed uint32
}

Termios holds the TTY attributes. See man termios(4). Tested on linux386, linux/arm, linux/amd64,

freebsd/386, freebsd/arm, freebsd/amd64.

See tremios_64.go for darwin.

func MakeRaw

func MakeRaw(fd uintptr) (*Termios, error)

MakeRaw sets the flags stored in the termios structure for the given terminal fd to a state disabling all input and output processing, giving a “raw I/O path”. It returns the current terminal's termios struct to allow to revert with TcSetAttr

func TcGetAttr

func TcGetAttr(fd uintptr) (*Termios, error)

TcGetAttr retrieves the current terminal settings and returns it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL