diff options
| author | David Greenman <dg@FreeBSD.org> | 1995-08-30 07:43:03 +0000 |
|---|---|---|
| committer | David Greenman <dg@FreeBSD.org> | 1995-08-30 07:43:03 +0000 |
| commit | 4a053744bd0e5312ab87f7619310da9a2520293c (patch) | |
| tree | 49b60fd7262772accc0b3bf5dd3e34431099a4b8 /lib | |
| parent | d56b71ad20a7bfa121034a7093f873e3ff5c03cc (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libedit/term.c | 91 | ||||
| -rw-r--r-- | lib/libedit/term.h | 2 |
2 files changed, 5 insertions, 88 deletions
diff --git a/lib/libedit/term.c b/lib/libedit/term.c index 8d641f0e075e..e85e41bd316a 100644 --- a/lib/libedit/term.c +++ b/lib/libedit/term.c @@ -49,7 +49,7 @@ static char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/4/93"; #include <string.h> #include <stdlib.h> #include <unistd.h> -#include "termcap.h" /* XXX: should be <termcap.h> */ +#include <termcap.h> #include <sys/types.h> #include "el.h" @@ -68,82 +68,6 @@ static char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/4/93"; #define Str(a) el->el_term.t_str[a] #define Val(a) el->el_term.t_val[a] -private struct { - char *b_name; - int b_rate; -} baud_rate[] = { -#ifdef B0 - { "0", B0 }, -#endif -#ifdef B50 - { "50", B50 }, -#endif -#ifdef B75 - { "75", B75 }, -#endif -#ifdef B110 - { "110", B110 }, -#endif -#ifdef B134 - { "134", B134 }, -#endif -#ifdef B150 - { "150", B150 }, -#endif -#ifdef B200 - { "200", B200 }, -#endif -#ifdef B300 - { "300", B300 }, -#endif -#ifdef B600 - { "600", B600 }, -#endif -#ifdef B900 - { "900", B900 }, -#endif -#ifdef B1200 - { "1200", B1200 }, -#endif -#ifdef B1800 - { "1800", B1800 }, -#endif -#ifdef B2400 - { "2400", B2400 }, -#endif -#ifdef B3600 - { "3600", B3600 }, -#endif -#ifdef B4800 - { "4800", B4800 }, -#endif -#ifdef B7200 - { "7200", B7200 }, -#endif -#ifdef B9600 - { "9600", B9600 }, -#endif -#ifdef EXTA - { "19200", EXTA }, -#endif -#ifdef B19200 - { "19200", B19200 }, -#endif -#ifdef EXTB - { "38400", EXTB }, -#endif -#ifdef B38400 - { "38400", B38400 }, -#endif -#ifdef B57600 - { "57600", B57600 }, -#endif -#ifdef B115200 - { "115200", B115200 }, -#endif - { NULL, 0 } -}; - private struct termcapstr { char *name; char *long_name; @@ -1131,11 +1055,11 @@ term_bind_arrow(el) /* term__putc(): * Add a character */ -protected void +protected int term__putc(c) int c; { - (void) fputc(c, term_outfile); + return fputc(c, term_outfile); } /* end term__putc */ @@ -1320,14 +1244,7 @@ term_echotc(el, argc, argv) } #endif else if (strcmp(*argv, "baud") == 0) { - int i; - - for (i = 0; baud_rate[i].b_name != NULL; i++) - if (el->el_tty.t_speed == baud_rate[i].b_rate) { - (void) fprintf(el->el_outfile, fmts, baud_rate[i].b_name); - return 0; - } - (void) fprintf(el->el_outfile, fmtd, 0); + (void) fprintf(el->el_outfile, "%ld\n", el->el_tty.t_speed); return 0; } else if (strcmp(*argv, "rows") == 0 || strcmp(*argv, "lines") == 0) { diff --git a/lib/libedit/term.h b/lib/libedit/term.h index 26da7c30d43c..f9de2216bfc1 100644 --- a/lib/libedit/term.h +++ b/lib/libedit/term.h @@ -100,7 +100,7 @@ protected int term_settc __P((EditLine *, int, char **)); protected int term_telltc __P((EditLine *, int, char **)); protected int term_echotc __P((EditLine *, int, char **)); -protected void term__putc __P((int)); +protected int term__putc __P((int)); protected void term__flush __P((void)); /* |
