AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
tty Struct Reference

A terminal, and its line discipline's state. More...

#include <tty.h>

Data Fields

char * cook
 the line being edited, in canonical mode
size_t size
 the size of cook
size_t pos
 how much of cook is used
int eof
 how many end-of-files (VEOF at the start of a line) reads still have to return
size_t col
 the output's column (for OPOST's ONOCR and ONLRET), and whether an ONLCR newline's CR was sent but not its NL yet (the device took no more)
int nl_owed
struct termios tios
struct winsize ws
int stopped
 whether output is stopped (IXON: VSTOP came); writes wait on start_wait for VSTART.
struct waitq start_wait
int start_waiters
int gone
struct dev * dev
 the terminal's device
struct session * session
 the session it is the controlling terminal of, or NULL
struct pgroup * fg
 the foreground process group, or NULL
struct vnode * vnode
 the device's vnode, which /dev/tty opens in its place
void * p
 the device's own data
ttyio master_write
 writes to the master side: input, as if typed
ttyio slave_write
 writes to the slave side: output, for the device
void(*) input_flush (struct tty *tty)
 discards the input that readers haven't read yet

Detailed Description

A terminal, and its line discipline's state.

Definition at line 25 of file tty.h.

Field Documentation

◆ col

size_t tty::col

the output's column (for OPOST's ONOCR and ONLRET), and whether an ONLCR newline's CR was sent but not its NL yet (the device took no more)

Definition at line 42 of file tty.h.

Referenced by tty_new(), and tty_slave_write().

◆ cook

char* tty::cook

the line being edited, in canonical mode

Definition at line 27 of file tty.h.

Referenced by tty_deliver(), tty_erase(), tty_master_write(), tty_new(), and tty_release().

◆ dev

struct dev* tty::dev

the terminal's device

Definition at line 57 of file tty.h.

Referenced by pty_new().

◆ eof

int tty::eof

how many end-of-files (VEOF at the start of a line) reads still have to return

Definition at line 37 of file tty.h.

Referenced by tty_can_read(), tty_eof(), tty_flush(), and tty_master_write().

◆ fg

struct pgroup* tty::fg

the foreground process group, or NULL

Definition at line 63 of file tty.h.

Referenced by pgrp_release(), tty_background(), tty_hangup(), tty_ioctl(), tty_open(), and tty_signal().

◆ gone

int tty::gone

Definition at line 54 of file tty.h.

Referenced by tty_free(), and tty_wait_start().

◆ input_flush

void(*) tty::input_flush(struct tty *tty)

discards the input that readers haven't read yet

Definition at line 80 of file tty.h.

Referenced by pty_new(), tty_flush(), uart_setup(), and vt_setup().

◆ master_write

ttyio tty::master_write

writes to the master side: input, as if typed

Definition at line 74 of file tty.h.

Referenced by tty_new(), tty_out(), and tty_slave_write().

◆ nl_owed

int tty::nl_owed

Definition at line 43 of file tty.h.

Referenced by tty_new(), and tty_slave_write().

◆ p

◆ pos

size_t tty::pos

how much of cook is used

Definition at line 33 of file tty.h.

Referenced by tty_deliver(), tty_erase(), tty_flush(), tty_master_write(), tty_new(), and tty_signal().

◆ session

struct session* tty::session

the session it is the controlling terminal of, or NULL

Definition at line 60 of file tty.h.

Referenced by pgrp_release(), tty_background(), tty_hangup(), tty_ioctl(), tty_open(), and vt_in_use().

◆ size

size_t tty::size

the size of cook

Definition at line 30 of file tty.h.

Referenced by tty_master_write(), and tty_new().

◆ slave_write

ttyio tty::slave_write

writes to the slave side: output, for the device

Definition at line 77 of file tty.h.

Referenced by tty_deliver(), tty_master_write(), and tty_new().

◆ start_wait

struct waitq tty::start_wait

Definition at line 52 of file tty.h.

Referenced by tty_free(), tty_ioctl(), tty_master_write(), and tty_wait_start().

◆ start_waiters

int tty::start_waiters

Definition at line 53 of file tty.h.

Referenced by tty_free(), and tty_wait_start().

◆ stopped

int tty::stopped

whether output is stopped (IXON: VSTOP came); writes wait on start_wait for VSTART.

start_waiters counts them: tty_free() marks the terminal gone and leaves freeing it to the last one

Definition at line 51 of file tty.h.

Referenced by tty_free(), tty_ioctl(), tty_master_write(), tty_wait_start(), and tty_write_iobuf().

◆ tios

◆ vnode

struct vnode* tty::vnode

the device's vnode, which /dev/tty opens in its place

Definition at line 66 of file tty.h.

Referenced by ctty_open(), pty_new(), uart_setup(), and vt_file_open().

◆ ws

struct winsize tty::ws

Definition at line 46 of file tty.h.

Referenced by tty_ioctl(), tty_new(), and vt_setup().


The documentation for this struct was generated from the following file:
  • kernel/include/dev/tty.h