version 1.13, 2001/11/20 20:50:00 |
version 1.14, 2001/11/21 15:26:39 |
|
|
|
|
#ifndef lint |
#ifndef lint |
#if 0 |
#if 0 |
static char sccsid[] = "@(#)tty.c 8.2 (Berkeley) 4/20/95"; |
static const char sccsid[] = "@(#)tty.c 8.2 (Berkeley) 4/20/95"; |
#else |
#else |
static char rcsid[] = "$OpenBSD$"; |
static const char rcsid[] = "$OpenBSD$"; |
#endif |
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
|
|
/* |
/* |
* Read all relevant header fields. |
* Read all relevant header fields. |
*/ |
*/ |
|
|
int |
int |
grabh(hp, gflags) |
grabh(struct header *hp, int gflags) |
struct header *hp; |
|
int gflags; |
|
{ |
{ |
struct termios ttybuf; |
struct termios ttybuf; |
#ifndef TIOCSTI |
#ifndef TIOCSTI |
|
|
#endif |
#endif |
if (gflags & GTO) { |
if (gflags & GTO) { |
#ifndef TIOCSTI |
#ifndef TIOCSTI |
if (!ttyset && hp->h_to != NIL) |
if (!ttyset && hp->h_to != NULL) |
ttyset++, tcsetattr(fileno(stdin), TCSADRAIN, &ttybuf); |
ttyset++, tcsetattr(fileno(stdin), TCSADRAIN, &ttybuf); |
#endif |
#endif |
s = readtty("To: ", detract(hp->h_to, 0)); |
s = readtty("To: ", detract(hp->h_to, 0)); |
|
|
} |
} |
if (gflags & GCC) { |
if (gflags & GCC) { |
#ifndef TIOCSTI |
#ifndef TIOCSTI |
if (!ttyset && hp->h_cc != NIL) |
if (!ttyset && hp->h_cc != NULL) |
ttyset++, tcsetattr(fileno(stdin), TCSADRAIN, &ttybuf); |
ttyset++, tcsetattr(fileno(stdin), TCSADRAIN, &ttybuf); |
#endif |
#endif |
s = readtty("Cc: ", detract(hp->h_cc, 0)); |
s = readtty("Cc: ", detract(hp->h_cc, 0)); |
|
|
} |
} |
if (gflags & GBCC) { |
if (gflags & GBCC) { |
#ifndef TIOCSTI |
#ifndef TIOCSTI |
if (!ttyset && hp->h_bcc != NIL) |
if (!ttyset && hp->h_bcc != NULL) |
ttyset++, tcsetattr(fileno(stdin), TCSADRAIN, &ttybuf); |
ttyset++, tcsetattr(fileno(stdin), TCSADRAIN, &ttybuf); |
#endif |
#endif |
s = readtty("Bcc: ", detract(hp->h_bcc, 0)); |
s = readtty("Bcc: ", detract(hp->h_bcc, 0)); |
|
|
* be read. |
* be read. |
* |
* |
*/ |
*/ |
|
|
char * |
char * |
readtty(pr, src) |
readtty(char *pr, char *src) |
char pr[], src[]; |
|
{ |
{ |
struct sigaction act, oact; |
struct sigaction act, oact; |
sigset_t oset; |
|
char ch, canonb[BUFSIZ]; |
char ch, canonb[BUFSIZ]; |
char *cp, *cp2; |
char *cp, *cp2; |
|
sigset_t oset; |
int c; |
int c; |
|
|
fputs(pr, stdout); |
fputs(pr, stdout); |
|
|
* Receipt continuation. |
* Receipt continuation. |
*/ |
*/ |
void |
void |
ttystop(s) |
ttystop(int s) |
int s; |
|
{ |
{ |
struct sigaction act, oact; |
struct sigaction act, oact; |
sigset_t nset; |
sigset_t nset; |
|
|
|
|
/*ARGSUSED*/ |
/*ARGSUSED*/ |
void |
void |
ttyint(s) |
ttyint(int s) |
int s; |
|
{ |
{ |
|
|
ttysignal = s; |
ttysignal = s; |