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/modes.c | 10 +++++++++- bin/stty/print.c | 29 +++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 7 deletions(-) (limited to 'bin/stty') diff --git a/bin/stty/modes.c b/bin/stty/modes.c index 31e716b..0aa7438 100644 --- a/bin/stty/modes.c +++ b/bin/stty/modes.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: modes.c,v 1.2 1994/09/24 02:58:59 davidg Exp $ */ #ifndef lint @@ -81,6 +81,14 @@ struct modes cmodes[] = { { "-clocal", 0, CLOCAL }, { "crtscts", CRTSCTS, 0 }, { "-crtscts", 0, CRTSCTS }, + { "ctsflow", CCTS_OFLOW, 0 }, + { "-ctsflow", 0, CCTS_OFLOW }, + { "dsrflow", CDSR_OFLOW, 0 }, + { "-dsrflow", 0, CDSR_OFLOW }, + { "dtrflow", CDTR_IFLOW, 0 }, + { "-dtrflow", 0, CDTR_IFLOW }, + { "rtsflow", CRTS_IFLOW, 0 }, + { "-rtsflow", 0, CRTS_IFLOW }, { "mdmbuf", MDMBUF, 0 }, { "-mdmbuf", 0, MDMBUF }, { NULL }, 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