summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-12-11 18:27:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-12-11 18:27:20 +0000
commit0e86e905ea13bd4c4efeb5005454a692bd1a12a4 (patch)
tree9d46ef52ea3bc184f2990ea2d947735472a281b4 /sbin
parent8b18de46b960417e4148a935726a5c80042aa3cd (diff)
ansi
Diffstat (limited to 'sbin')
-rw-r--r--sbin/wsconsctl/display.c10
-rw-r--r--sbin/wsconsctl/keyboard.c49
-rw-r--r--sbin/wsconsctl/keysym.c29
-rw-r--r--sbin/wsconsctl/mouse.c16
-rw-r--r--sbin/wsconsctl/util.c40
5 files changed, 60 insertions, 84 deletions
diff --git a/sbin/wsconsctl/display.c b/sbin/wsconsctl/display.c
index 220c6242f31..3e60a3c0b0b 100644
--- a/sbin/wsconsctl/display.c
+++ b/sbin/wsconsctl/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.6 2002/05/22 20:36:06 mickey Exp $ */
+/* $OpenBSD: display.c,v 1.7 2002/12/11 18:27:19 deraadt Exp $ */
/* $NetBSD: display.c,v 1.1 1998/12/28 14:01:16 hannken Exp $ */
/*-
@@ -68,9 +68,7 @@ struct field display_field_tab[] = {
#define fillioctl(n) { cmd = n; cmd_str = #n; }
void
-display_get_values(pre, fd)
- const char *pre;
- int fd;
+display_get_values(const char *pre, int fd)
{
struct wsdisplay_addscreendata gscr;
struct wsdisplay_param param;
@@ -149,9 +147,7 @@ display_get_values(pre, fd)
}
void
-display_put_values(pre, fd)
- const char *pre;
- int fd;
+display_put_values(const char *pre, int fd)
{
struct wsdisplay_param param;
struct wsdisplay_burner burners;
diff --git a/sbin/wsconsctl/keyboard.c b/sbin/wsconsctl/keyboard.c
index 2dc44e0bf7c..7d3a5f67495 100644
--- a/sbin/wsconsctl/keyboard.c
+++ b/sbin/wsconsctl/keyboard.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keyboard.c,v 1.3 2001/10/24 17:45:59 miod Exp $ */
+/* $OpenBSD: keyboard.c,v 1.4 2002/12/11 18:27:19 deraadt Exp $ */
/* $NetBSD: keyboard.c 1.1 1998/12/28 14:01:17 hannken Exp $ */
/*-
@@ -74,9 +74,7 @@ struct field keyboard_field_tab[] = {
};
void
-keyboard_get_values(pre, fd)
- const char *pre;
- int fd;
+keyboard_get_values(const char *pre, int fd)
{
if (field_by_value(keyboard_field_tab, &kbtype)->flags & FLG_GET)
if (ioctl(fd, WSKBDIO_GTYPE, &kbtype) < 0)
@@ -137,9 +135,7 @@ keyboard_get_values(pre, fd)
}
void
-keyboard_put_values(pre, fd)
- const char *pre;
- int fd;
+keyboard_put_values(const char *pre, int fd)
{
bell.which = 0;
if (field_by_value(keyboard_field_tab, &bell.pitch)->flags & FLG_SET)
@@ -152,11 +148,14 @@ keyboard_put_values(pre, fd)
warn("WSKBDIO_SETBELL");
else {
if (bell.which & WSKBD_BELL_DOPITCH)
- pr_field(pre, field_by_value(keyboard_field_tab, &bell.pitch), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &bell.pitch), " -> ");
if (bell.which & WSKBD_BELL_DOPERIOD)
- pr_field(pre, field_by_value(keyboard_field_tab, &bell.period), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &bell.period), " -> ");
if (bell.which & WSKBD_BELL_DOVOLUME)
- pr_field(pre, field_by_value(keyboard_field_tab, &bell.volume), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &bell.volume), " -> ");
}
dfbell.which = 0;
@@ -171,18 +170,22 @@ keyboard_put_values(pre, fd)
warn("WSKBDIO_SETDEFAULTBELL");
else {
if (dfbell.which & WSKBD_BELL_DOPITCH)
- pr_field(pre, field_by_value(keyboard_field_tab, &dfbell.pitch), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &dfbell.pitch), " -> ");
if (dfbell.which & WSKBD_BELL_DOPERIOD)
- pr_field(pre, field_by_value(keyboard_field_tab, &dfbell.period), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &dfbell.period), " -> ");
if (dfbell.which & WSKBD_BELL_DOVOLUME)
- pr_field(pre, field_by_value(keyboard_field_tab, &dfbell.volume), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &dfbell.volume), " -> ");
}
if (field_by_value(keyboard_field_tab, &kbmap)->flags & FLG_SET) {
if (ioctl(fd, WSKBDIO_SETMAP, &kbmap) < 0)
warn("WSKBDIO_SETMAP");
else {
- pr_field(pre, field_by_value(keyboard_field_tab, &kbmap), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &kbmap), " -> ");
}
}
@@ -196,9 +199,11 @@ keyboard_put_values(pre, fd)
warn("WSKBDIO_SETKEYREPEAT");
else {
if (repeat.which & WSKBD_KEYREPEAT_DODEL1)
- pr_field(pre, field_by_value(keyboard_field_tab, &repeat.del1), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &repeat.del1), " -> ");
if (repeat.which & WSKBD_KEYREPEAT_DODELN)
- pr_field(pre, field_by_value(keyboard_field_tab, &repeat.delN), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &repeat.delN), " -> ");
}
dfrepeat.which = 0;
@@ -211,16 +216,19 @@ keyboard_put_values(pre, fd)
warn("WSKBDIO_SETDEFAULTKEYREPEAT");
else {
if (dfrepeat.which &WSKBD_KEYREPEAT_DODEL1)
- pr_field(pre, field_by_value(keyboard_field_tab, &dfrepeat.del1), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &dfrepeat.del1), " -> ");
if (dfrepeat.which & WSKBD_KEYREPEAT_DODELN)
- pr_field(pre, field_by_value(keyboard_field_tab, &dfrepeat.delN), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &dfrepeat.delN), " -> ");
}
if (field_by_value(keyboard_field_tab, &ledstate)->flags & FLG_SET) {
if (ioctl(fd, WSKBDIO_SETLEDS, &ledstate) < 0)
warn("WSKBDIO_SETLEDS");
else {
- pr_field(pre, field_by_value(keyboard_field_tab, &ledstate), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &ledstate), " -> ");
}
}
@@ -228,7 +236,8 @@ keyboard_put_values(pre, fd)
if (ioctl(fd, WSKBDIO_SETENCODING, &kbdencoding) < 0)
warn("WSKBDIO_SETENCODING");
else {
- pr_field(pre, field_by_value(keyboard_field_tab, &kbdencoding), " -> ");
+ pr_field(pre, field_by_value(keyboard_field_tab,
+ &kbdencoding), " -> ");
}
}
}
diff --git a/sbin/wsconsctl/keysym.c b/sbin/wsconsctl/keysym.c
index c41c921c22d..7d3e03b4b1e 100644
--- a/sbin/wsconsctl/keysym.c
+++ b/sbin/wsconsctl/keysym.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keysym.c,v 1.2 2002/02/16 21:27:38 millert Exp $ */
+/* $OpenBSD: keysym.c,v 1.3 2002/12/11 18:27:19 deraadt Exp $ */
/* $NetBSD: keysym.c,v 1.3 1999/02/08 11:08:23 hannken Exp $ */
/*-
@@ -95,39 +95,31 @@ static int bcmp_ksym(const void *, const void *);
static void sort_ksym_tab(void);
static int
-qcmp_name(a, b)
- const void *a;
- const void *b;
+qcmp_name(const void *a, const void *b)
{
return(strcmp(((struct ksym *) a)->name, ((struct ksym *) b)->name));
}
static int
-qcmp_ksym(a, b)
- const void *a;
- const void *b;
+qcmp_ksym(const void *a, const void *b)
{
return(((struct ksym *) b)->value - ((struct ksym *) a)->value);
}
static int
-bcmp_name(a, b)
- const void *a;
- const void *b;
+bcmp_name(const void *a, const void *b)
{
return(strcmp((char *) a, ((struct ksym *) b)->name));
}
static int
-bcmp_ksym(a, b)
- const void *a;
- const void *b;
+bcmp_ksym(const void *a, const void *b)
{
return(((struct ksym *) b)->value - *((int *) a));
}
static void
-sort_ksym_tab()
+sort_ksym_tab(void)
{
int i;
@@ -141,8 +133,7 @@ sort_ksym_tab()
}
char *
-ksym2name(k)
- int k;
+ksym2name(int k)
{
static char tmp[20];
struct ksym *r;
@@ -162,8 +153,7 @@ ksym2name(k)
}
int
-name2ksym(n)
- char *n;
+name2ksym(char *n)
{
int res;
struct ksym *r;
@@ -183,8 +173,7 @@ name2ksym(n)
}
keysym_t
-ksym_upcase(ksym)
- keysym_t ksym;
+ksym_upcase(keysym_t ksym)
{
if (ksym >= KS_f1 && ksym <= KS_f20)
return(KS_F1 - KS_f1 + ksym);
diff --git a/sbin/wsconsctl/mouse.c b/sbin/wsconsctl/mouse.c
index f839481eac3..b559b5962b5 100644
--- a/sbin/wsconsctl/mouse.c
+++ b/sbin/wsconsctl/mouse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mouse.c,v 1.4 2001/10/24 17:45:59 miod Exp $ */
+/* $OpenBSD: mouse.c,v 1.5 2002/12/11 18:27:19 deraadt Exp $ */
/* $NetBSD: mouse.c,v 1.3 1999/11/15 13:47:30 ad Exp $ */
/*-
@@ -55,9 +55,7 @@ struct field mouse_field_tab[] = {
};
void
-mouse_get_values(pre, fd)
- const char *pre;
- int fd;
+mouse_get_values(const char *pre, int fd)
{
if (field_by_value(mouse_field_tab, &mstype)->flags & FLG_GET)
if (ioctl(fd, WSMOUSEIO_GTYPE, &mstype) < 0)
@@ -65,22 +63,22 @@ mouse_get_values(pre, fd)
}
void
-mouse_put_values(pre, fd)
- const char *pre;
- int fd;
+mouse_put_values(const char *pre, int fd)
{
if (field_by_value(mouse_field_tab, &resolution)->flags & FLG_SET) {
if (ioctl(fd, WSMOUSEIO_SRES, &resolution) < 0)
warn("WSMOUSEIO_SRES");
else {
- pr_field(pre, field_by_value(mouse_field_tab, &resolution), " -> ");
+ pr_field(pre, field_by_value(mouse_field_tab,
+ &resolution), " -> ");
}
}
if (field_by_value(mouse_field_tab, &samplerate)->flags & FLG_SET) {
if (ioctl(fd, WSMOUSEIO_SRATE, &samplerate) < 0)
warn("WSMOUSEIO_SRATE");
else {
- pr_field(pre, field_by_value(mouse_field_tab, &samplerate), " -> ");
+ pr_field(pre, field_by_value(mouse_field_tab,
+ &samplerate), " -> ");
}
}
}
diff --git a/sbin/wsconsctl/util.c b/sbin/wsconsctl/util.c
index 80c71d2bc40..4161d8ea4f9 100644
--- a/sbin/wsconsctl/util.c
+++ b/sbin/wsconsctl/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.14 2002/11/08 22:04:53 mickey Exp $ */
+/* $OpenBSD: util.c,v 1.15 2002/12/11 18:27:19 deraadt Exp $ */
/* $NetBSD: util.c,v 1.8 2000/03/14 08:11:53 sato Exp $ */
/*-
@@ -125,9 +125,7 @@ int name2int(char *, const struct nameint *, int);
void print_kmap(struct wskbd_map_data *);
struct field *
-field_by_name(field_tab, name)
- struct field *field_tab;
- char *name;
+field_by_name(struct field *field_tab, char *name)
{
const char *p = strchr(name, '.');
@@ -142,9 +140,7 @@ field_by_name(field_tab, name)
}
struct field *
-field_by_value(field_tab, addr)
- struct field *field_tab;
- void *addr;
+field_by_value(struct field *field_tab, void *addr)
{
for (; field_tab->name; field_tab++)
if (field_tab->valp == addr)
@@ -154,9 +150,7 @@ field_by_value(field_tab, addr)
}
char *
-int2name(val, uflag, tab, len)
- int val, uflag, len;
- const struct nameint *tab;
+int2name(int val, int uflag, const struct nameint *tab, int len)
{
static char tmp[20];
int i;
@@ -173,10 +167,7 @@ int2name(val, uflag, tab, len)
}
int
-name2int(val, tab, len)
- char *val;
- const struct nameint *tab;
- int len;
+name2int(char *val, const struct nameint *tab, int len)
{
int i;
@@ -187,15 +178,12 @@ name2int(val, tab, len)
}
void
-pr_field(pre, f, sep)
- const char *pre;
- struct field *f;
- const char *sep;
+pr_field(const char *pre, struct field *f, const char *sep)
{
struct field_pc *pc;
u_int flags;
- char *p;
int i, n;
+ char *p;
if (sep)
printf("%s.%s%s", pre, f->name, sep);
@@ -254,16 +242,13 @@ pr_field(pre, f, sep)
}
void
-rd_field(f, val, merge)
- struct field *f;
- char *val;
- int merge;
+rd_field(struct field *f, char *val, int merge)
{
+ struct wscons_keymap *mp;
struct field_pc *pc;
- int i;
u_int u, r, fr;
char *p;
- struct wscons_keymap *mp;
+ int i;
switch (f->format) {
case FMT_UINT:
@@ -348,11 +333,10 @@ rd_field(f, val, merge)
}
void
-print_kmap(map)
- struct wskbd_map_data *map;
+print_kmap(struct wskbd_map_data *map)
{
- int i;
struct wscons_keymap *mp;
+ int i;
for (i = 0; i < map->maplen; i++) {
mp = map->map + i;