diff options
Diffstat (limited to 'usr.sbin/lpr/lpd/key.c')
-rw-r--r-- | usr.sbin/lpr/lpd/key.c | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/usr.sbin/lpr/lpd/key.c b/usr.sbin/lpr/lpd/key.c index 259e97f28a6..bb1b136dfc8 100644 --- a/usr.sbin/lpr/lpd/key.c +++ b/usr.sbin/lpr/lpd/key.c @@ -1,4 +1,5 @@ -/* $OpenBSD: key.c,v 1.4 2002/02/16 21:28:03 millert Exp $ */ +/* $OpenBSD: key.c,v 1.5 2002/05/20 23:13:50 millert Exp $ */ +/* $NetBSD: key.c,v 1.3 1997/10/20 08:08:28 scottr Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -37,7 +38,7 @@ #if 0 static const char sccsid[] = "@(#)key.c 8.3 (Berkeley) 4/2/94"; #else -static const char rcsid[] = "$OpenBSD: key.c,v 1.4 2002/02/16 21:28:03 millert Exp $"; +static const char rcsid[] = "$OpenBSD: key.c,v 1.5 2002/05/20 23:13:50 millert Exp $"; #endif #endif /* not lint */ @@ -56,6 +57,8 @@ static const char rcsid[] = "$OpenBSD: key.c,v 1.4 2002/02/16 21:28:03 millert E #include "extern.h" __BEGIN_DECLS +static int + c_key(const void *, const void *); void f_cbreak(struct info *); void f_columns(struct info *); void f_dec(struct info *); @@ -75,7 +78,7 @@ static struct key { #define F_NEEDARG 0x01 /* needs an argument */ #define F_OFFOK 0x02 /* can turn off */ int flags; -} keys[] = { +} const keys[] = { { "cbreak", f_cbreak, F_OFFOK }, { "cols", f_columns, F_NEEDARG }, { "columns", f_columns, F_NEEDARG }, @@ -94,17 +97,14 @@ static struct key { }; static int -c_key(a, b) - const void *a, *b; +c_key(const void *a, const void *b) { return (strcmp(((struct key *)a)->name, ((struct key *)b)->name)); } int -ksearch(argvp, ip) - char ***argvp; - struct info *ip; +ksearch(char ***argvp, struct info *ip) { char *name; struct key *kp, tmp; @@ -134,8 +134,7 @@ ksearch(argvp, ip) } void -f_cbreak(ip) - struct info *ip; +f_cbreak(struct info *ip) { if (ip->off) @@ -150,8 +149,7 @@ f_cbreak(ip) } void -f_columns(ip) - struct info *ip; +f_columns(struct info *ip) { ip->win.ws_col = atoi(ip->arg); @@ -159,8 +157,7 @@ f_columns(ip) } void -f_dec(ip) - struct info *ip; +f_dec(struct info *ip) { ip->t.c_cc[VERASE] = (u_char)0177; @@ -173,8 +170,7 @@ f_dec(ip) } void -f_extproc(ip) - struct info *ip; +f_extproc(struct info *ip) { if (ip->set) { @@ -187,8 +183,7 @@ f_extproc(ip) } void -f_ispeed(ip) - struct info *ip; +f_ispeed(struct info *ip) { cfsetispeed(&ip->t, atoi(ip->arg)); @@ -196,8 +191,7 @@ f_ispeed(ip) } void -f_nl(ip) - struct info *ip; +f_nl(struct info *ip) { if (ip->off) { @@ -211,8 +205,7 @@ f_nl(ip) } void -f_ospeed(ip) - struct info *ip; +f_ospeed(struct info *ip) { cfsetospeed(&ip->t, atoi(ip->arg)); @@ -220,8 +213,7 @@ f_ospeed(ip) } void -f_raw(ip) - struct info *ip; +f_raw(struct info *ip) { if (ip->off) @@ -235,8 +227,7 @@ f_raw(ip) } void -f_rows(ip) - struct info *ip; +f_rows(struct info *ip) { ip->win.ws_row = atoi(ip->arg); @@ -244,8 +235,7 @@ f_rows(ip) } void -f_sane(ip) - struct info *ip; +f_sane(struct info *ip) { ip->t.c_cflag = TTYDEF_CFLAG | (ip->t.c_cflag & (CLOCAL|CRTSCTS)); @@ -259,8 +249,7 @@ f_sane(ip) } void -f_tty(ip) - struct info *ip; +f_tty(struct info *ip) { int tmp; |