key.c (59714) | key.c (59788) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)key.c 8.3 (Berkeley) 4/2/94"; 37#else 38static const char rcsid[] = | 1/*- 2 * Copyright (c) 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)key.c 8.3 (Berkeley) 4/2/94"; 37#else 38static const char rcsid[] = |
39 "$FreeBSD: head/bin/stty/key.c 59714 2000-04-27 21:31:23Z ache $"; | 39 "$FreeBSD: head/bin/stty/key.c 59788 2000-04-30 17:04:26Z ache $"; |
40#endif 41#endif /* not lint */ 42 43#include <sys/types.h> 44 45#include <err.h> 46#include <errno.h> 47#include <stdlib.h> 48#include <stdio.h> 49#include <string.h> 50 51#include "stty.h" 52#include "extern.h" 53 54__BEGIN_DECLS 55void f_all __P((struct info *)); 56void f_cbreak __P((struct info *)); 57void f_columns __P((struct info *)); 58void f_dec __P((struct info *)); | 40#endif 41#endif /* not lint */ 42 43#include <sys/types.h> 44 45#include <err.h> 46#include <errno.h> 47#include <stdlib.h> 48#include <stdio.h> 49#include <string.h> 50 51#include "stty.h" 52#include "extern.h" 53 54__BEGIN_DECLS 55void f_all __P((struct info *)); 56void f_cbreak __P((struct info *)); 57void f_columns __P((struct info *)); 58void f_dec __P((struct info *)); |
59void f_drainwait __P((struct info *)); | |
60void f_everything __P((struct info *)); 61void f_extproc __P((struct info *)); 62void f_ispeed __P((struct info *)); 63void f_nl __P((struct info *)); 64void f_ospeed __P((struct info *)); 65void f_raw __P((struct info *)); 66void f_rows __P((struct info *)); 67void f_sane __P((struct info *)); --- 10 unchanged lines hidden (view full) --- 78 int flags; 79} keys[] = { 80 { "all", f_all, 0 }, 81 { "cbreak", f_cbreak, F_OFFOK }, 82 { "cols", f_columns, F_NEEDARG }, 83 { "columns", f_columns, F_NEEDARG }, 84 { "cooked", f_sane, 0 }, 85 { "dec", f_dec, 0 }, | 59void f_everything __P((struct info *)); 60void f_extproc __P((struct info *)); 61void f_ispeed __P((struct info *)); 62void f_nl __P((struct info *)); 63void f_ospeed __P((struct info *)); 64void f_raw __P((struct info *)); 65void f_rows __P((struct info *)); 66void f_sane __P((struct info *)); --- 10 unchanged lines hidden (view full) --- 77 int flags; 78} keys[] = { 79 { "all", f_all, 0 }, 80 { "cbreak", f_cbreak, F_OFFOK }, 81 { "cols", f_columns, F_NEEDARG }, 82 { "columns", f_columns, F_NEEDARG }, 83 { "cooked", f_sane, 0 }, 84 { "dec", f_dec, 0 }, |
86 { "drainwait", f_drainwait, F_NEEDARG }, | |
87 { "everything", f_everything, 0 }, 88 { "extproc", f_extproc, F_OFFOK }, 89 { "ispeed", f_ispeed, F_NEEDARG }, 90 { "new", f_tty, 0 }, 91 { "nl", f_nl, F_OFFOK }, 92 { "old", f_tty, 0 }, 93 { "ospeed", f_ospeed, F_NEEDARG }, 94 { "raw", f_raw, F_OFFOK }, --- 42 unchanged lines hidden (view full) --- 137 kp->f(ip); 138 return (1); 139} 140 141void 142f_all(ip) 143 struct info *ip; 144{ | 85 { "everything", f_everything, 0 }, 86 { "extproc", f_extproc, F_OFFOK }, 87 { "ispeed", f_ispeed, F_NEEDARG }, 88 { "new", f_tty, 0 }, 89 { "nl", f_nl, F_OFFOK }, 90 { "old", f_tty, 0 }, 91 { "ospeed", f_ospeed, F_NEEDARG }, 92 { "raw", f_raw, F_OFFOK }, --- 42 unchanged lines hidden (view full) --- 135 kp->f(ip); 136 return (1); 137} 138 139void 140f_all(ip) 141 struct info *ip; 142{ |
145 print(&ip->t, &ip->win, ip->ldisc, ip->timeout, BSD); | 143 print(&ip->t, &ip->win, ip->ldisc, BSD); |
146} 147 148void 149f_cbreak(ip) 150 struct info *ip; 151{ 152 153 if (ip->off) --- 26 unchanged lines hidden (view full) --- 180 ip->t.c_cc[VINTR] = CTRL('c'); 181 ip->t.c_lflag &= ~ECHOPRT; 182 ip->t.c_lflag |= ECHOE|ECHOKE|ECHOCTL; 183 ip->t.c_iflag &= ~IXANY; 184 ip->set = 1; 185} 186 187void | 144} 145 146void 147f_cbreak(ip) 148 struct info *ip; 149{ 150 151 if (ip->off) --- 26 unchanged lines hidden (view full) --- 178 ip->t.c_cc[VINTR] = CTRL('c'); 179 ip->t.c_lflag &= ~ECHOPRT; 180 ip->t.c_lflag |= ECHOE|ECHOKE|ECHOCTL; 181 ip->t.c_iflag &= ~IXANY; 182 ip->set = 1; 183} 184 185void |
188f_drainwait(ip) 189 struct info *ip; 190{ 191 192 ip->timeout = atoi(ip->arg); 193 ip->tset = 1; 194} 195 196void | |
197f_everything(ip) 198 struct info *ip; 199{ 200 | 186f_everything(ip) 187 struct info *ip; 188{ 189 |
201 print(&ip->t, &ip->win, ip->ldisc, ip->timeout, BSD); | 190 print(&ip->t, &ip->win, ip->ldisc, BSD); |
202} 203 204void 205f_extproc(ip) 206 struct info *ip; 207{ 208 209 if (ip->off) { --- 106 unchanged lines hidden --- | 191} 192 193void 194f_extproc(ip) 195 struct info *ip; 196{ 197 198 if (ip->off) { --- 106 unchanged lines hidden --- |