From c6d77acc4398534b4d12fd1c7714897281e09abb Mon Sep 17 00:00:00 2001 From: bde Date: Sat, 29 Apr 1995 15:17:17 +0000 Subject: Support nonstandard (not yet all supported) flow control options. `ctsflow' and `rtsflow' are the components of `crtscts'. `dtrflow' and `dsrflow' are new and not yet supported. `dtrflow' may be useful for Cyclades serial careds, which have h/w support for it and no h/w support for `rtsflow'. print.c: Report NTTYDISC in case the line is in this obsolescent state. --- bin/stty/print.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'bin/stty/print.c') diff --git a/bin/stty/print.c b/bin/stty/print.c index b56fc88..6b9a572 100644 --- a/bin/stty/print.c +++ b/bin/stty/print.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: print.c,v 1.2 1994/09/24 02:58:59 davidg Exp $ + * $Id: print.c,v 1.3 1995/04/28 19:29:30 ache Exp $ */ #ifndef lint @@ -46,6 +46,8 @@ static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94"; #include "stty.h" #include "extern.h" +#include /* XXX NTTYDISC is too well hidden */ + static void binit __P((char *)); static void bput __P((char *)); static char *ccval __P((struct cchar *, int)); @@ -71,6 +73,9 @@ print(tp, wp, ldisc, fmt) case TABLDISC: cnt += printf("tablet disc; "); break; + case NTTYDISC: + cnt += printf("new tty disc; "); + break; case SLIPDISC: cnt += printf("slip disc; "); break; @@ -96,10 +101,10 @@ print(tp, wp, ldisc, fmt) if (cnt) (void)printf("\n"); -#define on(f) ((tmp&f) != 0) +#define on(f) ((tmp & (f)) != 0) #define put(n, f, d) \ - if (fmt >= BSD || on(f) != d) \ - bput(n + on(f)); + if (fmt >= BSD || on(f) != (d)) \ + bput((n) + on(f)); /* "local" flags */ tmp = tp->c_lflag; @@ -169,8 +174,20 @@ print(tp, wp, ldisc, fmt) put("-hupcl", HUPCL, 1); put("-clocal", CLOCAL, 0); put("-cstopb", CSTOPB, 0); - put("-crtscts", CRTSCTS, 0); - put("-mdmbuf", MDMBUF, 0); + switch(tmp & (CCTS_OFLOW | CRTS_IFLOW)) { + case CCTS_OFLOW: + bput("ctsflow"); + break; + case CRTS_IFLOW: + bput("rtsflow"); + break; + default: + put("-crtscts", CCTS_OFLOW | CRTS_IFLOW, 0); + break; + } + put("-dsrflow", CDSR_OFLOW, 0); + put("-dtrflow", CDTR_IFLOW, 0); + put("-mdmbuf", MDMBUF, 0); /* XXX mdmbuf == dtrflow */ /* special control characters */ cc = tp->c_cc; -- cgit v1.1