Go to the first, previous, next, last section, table of contents.
The termios
functions allow to control terminals and asynchronous
communications ports. The DJGPP implementation currently supports the
termios
functionality for console devices only. It does that by
reading the keyboard via the BIOS Int 16h and writes to the screen via
the direct output interrupt 29h. This I/O redirection is performed by
the special hook internal to the library.
Many of the termios
functions accept a termiosp argument
which is a pointer to a struct termios
variable. Here's the
description of this structure:
#define NCCS 12 struct termios { cc_t c_cc[NCCS]; /* control characters */ tcflag_t c_cflag; /* control modes */ tcflag_t c_iflag; /* input modes */ tcflag_t c_lflag; /* local modes */ tcflag_t c_oflag; /* output modes */ speed_t c_ispeed; /* input baudrate */ speed_t c_ospeed; /* output baudrate */ }
The array c_cc[]
defines the special control characters. the
following table lists the supported control functions the default
characters which invoke those functions, and the default values for MIN
and TIME parameters:
VEOL
, VKILL
, etc.) produce
their effect only under the canonical input processing, that is,
when the ICANON
bit in the c_lflag
member of struct
termios
(see below) is set. If ICANON
is not set, all
characters are processed as regular characters and returned to the
caller; only the VMIN
and VTIME
parameters are meaningful
in the non-canonical processing mode.
The VEOL
character can be used to signal end of line (and thus
end of input in the canonical mode) in addition to the normal RET
key. In the non-canonical mode, input ends as soon as at least
VMIN
characters are received.
Note that the values of VMIN
and VTIME
are currently
ignored; termios
functions always work as if VMIN
were 1
and VTIME
were zero. Other parameters are supported (for console
devices only), except that VSTOP and VSTART characters are not inserted
to the input, but otherwise produce no effect.
The c_cflag
member of struct termios
describes the
hardware terminal control, as follows:
c_cflag
is (CS8|CREAD|CLOCAL)
.
The c_lflag
member of struct termios
defines the local
modes that control the terminal functions:
c_lflag
is
(ISIG|ICANON|ECHO|IEXTEN|ECHOE|ECHOKE|ECHOCTL)
.
The c_iflag
member of struct termios
describes the input
control:
c_iflag
is (BRKINT|ICRNL|IMAXBEL)
.
The c_oflag
member of struct termios
specifies the output
handling:
OPOST
bit is not set, all the other flags are
ignored and the characters are output verbatim. The default value of
c_oflag
is (OPOST|ONLCR|ONOEOT)
.
The c_ispeed
and c_ospeed
members specify, respectively,
the input and output baudrate of the terminal. They are set by default
to 9600 baud, but the value is always ignored by this implementation,
since no asynchronous ports are used.
Go to the first, previous, next, last section, table of contents.