diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-05-08 22:31:10 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-05-08 22:31:10 +0000 |
commit | c212fa865e2055967a47ac71f46ad1216676cab1 (patch) | |
tree | fd3a61d72f4097fb8f806f1ebc458f8e527d53c7 /sbin/wsconsctl/util.c | |
parent | fda42b5add85625d515849886a87228d10924814 (diff) |
add more display variables (for screen burner).
implement boolean type for variables.
Diffstat (limited to 'sbin/wsconsctl/util.c')
-rw-r--r-- | sbin/wsconsctl/util.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sbin/wsconsctl/util.c b/sbin/wsconsctl/util.c index 83d3e95b21a..ea0435efae2 100644 --- a/sbin/wsconsctl/util.c +++ b/sbin/wsconsctl/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.3 2001/03/03 08:53:46 maja Exp $ */ +/* $OpenBSD: util.c,v 1.4 2001/05/08 22:31:09 mickey Exp $ */ /* $NetBSD: util.c,v 1.8 2000/03/14 08:11:53 sato Exp $ */ /*- @@ -195,6 +195,9 @@ pr_field(f, sep) case FMT_UINT: printf("%u", *((u_int *) f->valp)); break; + case FMT_BOOL: + printf("%s", *((u_int *) f->valp)? "on" : "off"); + break; case FMT_KBDTYPE: p = int2name(*((u_int *) f->valp), 1, kbtype_tab, TABLEN(kbtype_tab)); @@ -255,6 +258,12 @@ rd_field(f, val, merge) else *((u_int *) f->valp) = u; break; + case FMT_BOOL: + if (*val != 'o' || (val[1] != 'n' && + (val[1] != 'f' || val[2] != 'f'))) + errx(1, "%s: invalid value (on/off)", val); + *((u_int *) f->valp) = val[1] == 'n'? 1 : 0; + break; case FMT_KBDENC: p = strchr(val, '.'); if (p != NULL) |