xref: /original-bsd/usr.bin/uucp/libuu/setline.c (revision 0eaa7944)
1 #ifndef lint
2 static char sccsid[] = "@(#)setline.c	5.2 (Berkeley) 01/22/85";
3 #endif
4 
5 #include "uucp.h"
6 #ifdef	USG
7 #include <termio.h>
8 #endif
9 
10 #define PACKSIZE	64
11 #define SNDFILE	'S'
12 #define RCVFILE 'R'
13 #define RESET	'X'
14 
15 /*
16  *	optimize line setting for sending or receiving files
17  *
18  *	return code - none
19  */
20 setline(type)
21 char type;
22 {
23 #ifdef	USG
24 	static struct termio tbuf, sbuf;
25 	static int set = 0;
26 
27 	DEBUG(2, "setline - %c\n", type);
28 	if (IsTcpIp)
29 		return;
30 	switch(type) {
31 	case SNDFILE:
32 		break;
33 	case RCVFILE:
34 		ioctl(Ifn, TCGETA, &tbuf);
35 		sbuf = tbuf;
36 		tbuf.c_cc[VMIN] = PACKSIZE;
37 		ioctl(Ifn, TCSETAW, &tbuf);
38 		set++;
39 		break;
40 	case RESET:
41 		if (set == 0) break;
42 		set = 0;
43 		ioctl(Ifn, TCSETAW, &sbuf);
44 		break;
45 	}
46 #endif
47 }
48