148652Sbostic /*-
2*62386Sbostic * Copyright (c) 1985, 1993
3*62386Sbostic * The Regents of the University of California. All rights reserved.
448652Sbostic *
548652Sbostic * %sccs.include.proprietary.c%
648652Sbostic */
748652Sbostic
813668Ssam #ifndef lint
9*62386Sbostic static char sccsid[] = "@(#)setline.c 8.1 (Berkeley) 06/06/93";
1048652Sbostic #endif /* not lint */
1113668Ssam
1213668Ssam #include "uucp.h"
1317838Sralph #ifdef USG
1413668Ssam #include <termio.h>
1513668Ssam #endif
1613668Ssam
1713668Ssam #define PACKSIZE 64
1813668Ssam #define SNDFILE 'S'
1913668Ssam #define RCVFILE 'R'
2013668Ssam #define RESET 'X'
2113668Ssam
2223617Sbloom /*LINTLIBRARY*/
2323617Sbloom
2417838Sralph /*
2517838Sralph * optimize line setting for sending or receiving files
2617838Sralph *
2717838Sralph * return code - none
2817838Sralph */
2923617Sbloom /*ARGSUSED*/
setupline(type)3023617Sbloom setupline(type)
3113668Ssam char type;
3213668Ssam {
3317838Sralph #ifdef USG
3413668Ssam static struct termio tbuf, sbuf;
3513668Ssam static int set = 0;
3613668Ssam
3713668Ssam DEBUG(2, "setline - %c\n", type);
3817838Sralph if (IsTcpIp)
3913668Ssam return;
4013668Ssam switch(type) {
4113668Ssam case SNDFILE:
4213668Ssam break;
4313668Ssam case RCVFILE:
4413668Ssam ioctl(Ifn, TCGETA, &tbuf);
4513668Ssam sbuf = tbuf;
4613668Ssam tbuf.c_cc[VMIN] = PACKSIZE;
4713668Ssam ioctl(Ifn, TCSETAW, &tbuf);
4813668Ssam set++;
4913668Ssam break;
5013668Ssam case RESET:
5113668Ssam if (set == 0) break;
5213668Ssam set = 0;
5313668Ssam ioctl(Ifn, TCSETAW, &sbuf);
5413668Ssam break;
5513668Ssam }
5613668Ssam #endif
5713668Ssam }
58