summaryrefslogtreecommitdiff
path: root/bin/stty
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-11 23:42:13 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-11 23:42:13 +0000
commitb7e43e8440a0d47510d40dd5d9440dccf52a05f2 (patch)
tree20886296c48f50f9e7f28003e17761fd8acd14e0 /bin/stty
parenta760a3046bfab4c3721cea25480d9f998d1cf0e8 (diff)
ansification, art ok
Diffstat (limited to 'bin/stty')
-rw-r--r--bin/stty/cchar.c11
-rw-r--r--bin/stty/gfmt.c16
-rw-r--r--bin/stty/key.c68
-rw-r--r--bin/stty/modes.c8
-rw-r--r--bin/stty/print.c20
-rw-r--r--bin/stty/stty.c10
6 files changed, 45 insertions, 88 deletions
diff --git a/bin/stty/cchar.c b/bin/stty/cchar.c
index d02d3f008ef..16e3eec6c78 100644
--- a/bin/stty/cchar.c
+++ b/bin/stty/cchar.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cchar.c,v 1.9 2003/06/02 23:32:09 millert Exp $ */
+/* $OpenBSD: cchar.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $ */
/* $NetBSD: cchar.c,v 1.10 1996/05/07 18:20:05 jtc Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)cchar.c 8.5 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: cchar.c,v 1.9 2003/06/02 23:32:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: cchar.c,v 1.10 2003/06/11 23:42:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -86,16 +86,13 @@ const struct cchar cchars2[] = {
};
static int
-c_cchar(a, b)
- const void *a, *b;
+c_cchar(const void *a, const void *b)
{
return (strcmp(((struct cchar *)a)->name, ((struct cchar *)b)->name));
}
int
-csearch(argvp, ip)
- char ***argvp;
- struct info *ip;
+csearch(char ***argvp, struct info *ip)
{
struct cchar *cp, tmp;
long val;
diff --git a/bin/stty/gfmt.c b/bin/stty/gfmt.c
index 460196162b1..aee5896e66b 100644
--- a/bin/stty/gfmt.c
+++ b/bin/stty/gfmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gfmt.c,v 1.5 2003/06/02 23:32:09 millert Exp $ */
+/* $OpenBSD: gfmt.c,v 1.6 2003/06/11 23:42:12 deraadt Exp $ */
/* $NetBSD: gfmt.c,v 1.10 1996/05/07 18:20:08 jtc Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)gfmt.c 8.6 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: gfmt.c,v 1.5 2003/06/02 23:32:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: gfmt.c,v 1.6 2003/06/11 23:42:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -48,8 +48,7 @@ static char rcsid[] = "$OpenBSD: gfmt.c,v 1.5 2003/06/02 23:32:09 millert Exp $"
#include "extern.h"
static void
-gerr(s)
- char *s;
+gerr(char *s)
{
if (s)
errx(1, "illegal gfmt1 option -- %s", s);
@@ -58,10 +57,7 @@ gerr(s)
}
void
-gprint(tp, wp, ldisc)
- struct termios *tp;
- struct winsize *wp;
- int ldisc;
+gprint(struct termios *tp, struct winsize *wp, int ldisc)
{
const struct cchar *cp;
@@ -73,9 +69,7 @@ gprint(tp, wp, ldisc)
}
void
-gread(tp, s)
- struct termios *tp;
- char *s;
+gread(struct termios *tp, char *s)
{
const struct cchar *cp;
char *ep, *p;
diff --git a/bin/stty/key.c b/bin/stty/key.c
index f5808071cac..5d18a565aa1 100644
--- a/bin/stty/key.c
+++ b/bin/stty/key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.c,v 1.11 2003/06/02 23:32:09 millert Exp $ */
+/* $OpenBSD: key.c,v 1.12 2003/06/11 23:42:12 deraadt Exp $ */
/* $NetBSD: key.c,v 1.11 1995/09/07 06:57:11 jtc Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)key.c 8.4 (Berkeley) 2/20/95";
#else
-static char rcsid[] = "$OpenBSD: key.c,v 1.11 2003/06/02 23:32:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: key.c,v 1.12 2003/06/11 23:42:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -104,17 +104,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;
@@ -143,15 +140,13 @@ ksearch(argvp, ip)
}
void
-f_all(ip)
- struct info *ip;
+f_all(struct info *ip)
{
print(&ip->t, &ip->win, ip->ldisc, BSD);
}
void
-f_cbreak(ip)
- struct info *ip;
+f_cbreak(struct info *ip)
{
if (ip->off)
@@ -166,8 +161,7 @@ f_cbreak(ip)
}
void
-f_columns(ip)
- struct info *ip;
+f_columns(struct info *ip)
{
ip->win.ws_col = atoi(ip->arg);
@@ -175,8 +169,7 @@ f_columns(ip)
}
void
-f_dec(ip)
- struct info *ip;
+f_dec(struct info *ip)
{
ip->t.c_cc[VERASE] = (u_char)0177;
@@ -189,8 +182,7 @@ f_dec(ip)
}
void
-f_ek(ip)
- struct info *ip;
+f_ek(struct info *ip)
{
ip->t.c_cc[VERASE] = CERASE;
@@ -199,16 +191,14 @@ f_ek(ip)
}
void
-f_everything(ip)
- struct info *ip;
+f_everything(struct info *ip)
{
print(&ip->t, &ip->win, ip->ldisc, BSD);
}
void
-f_extproc(ip)
- struct info *ip;
+f_extproc(struct info *ip)
{
if (ip->off) {
@@ -222,8 +212,7 @@ f_extproc(ip)
}
void
-f_ispeed(ip)
- struct info *ip;
+f_ispeed(struct info *ip)
{
cfsetispeed(&ip->t, atoi(ip->arg));
@@ -231,8 +220,7 @@ f_ispeed(ip)
}
void
-f_lcase(ip)
- struct info *ip;
+f_lcase(struct info *ip)
{
if (ip->off) {
ip->t.c_iflag &= ~IUCLC;
@@ -247,8 +235,7 @@ f_lcase(ip)
}
void
-f_nl(ip)
- struct info *ip;
+f_nl(struct info *ip)
{
if (ip->off) {
@@ -262,8 +249,7 @@ f_nl(ip)
}
void
-f_ospeed(ip)
- struct info *ip;
+f_ospeed(struct info *ip)
{
cfsetospeed(&ip->t, atoi(ip->arg));
@@ -271,8 +257,7 @@ f_ospeed(ip)
}
void
-f_raw(ip)
- struct info *ip;
+f_raw(struct info *ip)
{
if (ip->off)
@@ -286,8 +271,7 @@ f_raw(ip)
}
void
-f_rows(ip)
- struct info *ip;
+f_rows(struct info *ip)
{
ip->win.ws_row = atoi(ip->arg);
@@ -295,8 +279,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));
@@ -310,24 +293,21 @@ f_sane(ip)
}
void
-f_size(ip)
- struct info *ip;
+f_size(struct info *ip)
{
(void)printf("%d %d\n", ip->win.ws_row, ip->win.ws_col);
}
void
-f_speed(ip)
- struct info *ip;
+f_speed(struct info *ip)
{
(void)printf("%d\n", cfgetospeed(&ip->t));
}
void
-f_tty(ip)
- struct info *ip;
+f_tty(struct info *ip)
{
int tmp;
@@ -337,16 +317,14 @@ f_tty(ip)
}
void
-f_ostart(ip)
- struct info *ip;
+f_ostart(struct info *ip)
{
if (ioctl (ip->fd, TIOCSTART) < 0)
err(1, "TIOCSTART");
}
void
-f_ostop(ip)
- struct info *ip;
+f_ostop(struct info *ip)
{
if (ioctl (ip->fd, TIOCSTOP) < 0)
err(1, "TIOCSTOP");
diff --git a/bin/stty/modes.c b/bin/stty/modes.c
index bd2afe40995..a79953c1d3d 100644
--- a/bin/stty/modes.c
+++ b/bin/stty/modes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modes.c,v 1.6 2003/06/02 23:32:09 millert Exp $ */
+/* $OpenBSD: modes.c,v 1.7 2003/06/11 23:42:12 deraadt Exp $ */
/* $NetBSD: modes.c,v 1.9 1996/05/07 18:20:09 jtc Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)modes.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: modes.c,v 1.6 2003/06/02 23:32:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: modes.c,v 1.7 2003/06/11 23:42:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -206,9 +206,7 @@ const struct modes omodes[] = {
#define CHK(s) (!strcmp(name, s))
int
-msearch(argvp, ip)
- char ***argvp;
- struct info *ip;
+msearch(char ***argvp, struct info *ip)
{
const struct modes *mp;
char *name;
diff --git a/bin/stty/print.c b/bin/stty/print.c
index f3a3c3589ae..0cfed316de7 100644
--- a/bin/stty/print.c
+++ b/bin/stty/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.10 2003/06/02 23:32:09 millert Exp $ */
+/* $OpenBSD: print.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $ */
/* $NetBSD: print.c,v 1.11 1996/05/07 18:20:10 jtc Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
-static char rcsid[] = "$OpenBSD: print.c,v 1.10 2003/06/02 23:32:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: print.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -52,11 +52,7 @@ static void bput(char *);
static char *ccval(const struct cchar *, int);
void
-print(tp, wp, ldisc, fmt)
- struct termios *tp;
- struct winsize *wp;
- int ldisc;
- enum FMT fmt;
+print(struct termios *tp, struct winsize *wp, int ldisc, enum FMT fmt)
{
const struct cchar *p;
long tmp;
@@ -220,8 +216,7 @@ static int col;
static char *label;
static void
-binit(lb)
- char *lb;
+binit(char *lb)
{
if (col) {
@@ -232,8 +227,7 @@ binit(lb)
}
static void
-bput(s)
- char *s;
+bput(char *s)
{
if (col == 0) {
@@ -249,9 +243,7 @@ bput(s)
}
static char *
-ccval(p, c)
- const struct cchar *p;
- int c;
+ccval(const struct cchar *p, int c)
{
static char buf[5];
char *bp;
diff --git a/bin/stty/stty.c b/bin/stty/stty.c
index 98970a68136..04be4dd104a 100644
--- a/bin/stty/stty.c
+++ b/bin/stty/stty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stty.c,v 1.10 2003/06/02 23:32:09 millert Exp $ */
+/* $OpenBSD: stty.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $ */
/* $NetBSD: stty.c,v 1.11 1995/03/21 09:11:30 cgd Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)stty.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: stty.c,v 1.10 2003/06/02 23:32:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: stty.c,v 1.11 2003/06/11 23:42:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -59,9 +59,7 @@ static char rcsid[] = "$OpenBSD: stty.c,v 1.10 2003/06/02 23:32:09 millert Exp $
#include "extern.h"
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct info i;
enum FMT fmt;
@@ -154,7 +152,7 @@ args: argc -= optind;
}
void
-usage()
+usage(void)
{
fprintf(stderr, "usage: %s [-a|-e|-g] [-f file] [operands]\n",
__progname);