|
|
coherent
stty() COHERENT System Call stty()
Set terminal modes
#iinncclluuddee <ssggttttyy.hh>
iinntt ssttttyy(_f_d, _s_g_p)
iinntt _f_d;
ssttrruucctt ssggttttyybb *_s_g_p;
The COHERENT system call ssttttyy sets a terminal's attributes. See
the Lexicon article for ssttttyy for information on terminal
attributes and their legal values.
***** Example *****
This example demonstrates both ssttttyy and ggttttyy. It sets terminal
input to read one character at a time (that is, it reads the
terminal in ``raw'' form). When you type `q', it restores the
terminal to its previous settings, and exits. For an additional
example, see the ppiippee Lexicon article.
#include <sgtty.h>
main()
{
struct sgttyb os, ns;
char buff;
printf("Waiting for q\n");
gtty(1, &os); /* save old state */
ns = os; /* get base of new state */
ns.sg_flags |= RAW;/* prevent <ctl-c> from working */
ns.sg_flags &= ~(ECHO|CRMOD);/* no echo for now... */
stty(1, &ns); /* set mode */
do {
buff = getchar();/* wait for the keyboard */
} while(buff != 'q');
stty(1, &os); /* reset mode */
}
***** Files *****
<ssggttttyy.hh> -- Header file
COHERENT Lexicon Page 1
stty() COHERENT System Call stty()
***** See Also *****
CCOOHHEERREENNTT ssyysstteemm ccaallllss, eexxeecc, ggttttyy(), iiooccttll(), ooppeenn(), rreeaadd(),
ssggttttyy.hh, ssttttyy, wwrriittee()
COHERENT Lexicon Page 2
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.