Use hline() and variants in a bunch of places.

This commit is contained in:
mycroft 2000-06-04 18:29:13 +00:00
parent c46119030a
commit 981f9b7d7b
6 changed files with 27 additions and 37 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: iostat.c,v 1.14 2000/06/03 21:00:42 thorpej Exp $ */ /* $NetBSD: iostat.c,v 1.15 2000/06/04 18:29:13 mycroft Exp $ */
/* /*
* Copyright (c) 1980, 1992, 1993 * Copyright (c) 1980, 1992, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93"; static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93";
#endif #endif
__RCSID("$NetBSD: iostat.c,v 1.14 2000/06/03 21:00:42 thorpej Exp $"); __RCSID("$NetBSD: iostat.c,v 1.15 2000/06/04 18:29:13 mycroft Exp $");
#endif not lint #endif not lint
#include <sys/param.h> #include <sys/param.h>
@ -313,9 +313,8 @@ histogram(val, colwidth, scale)
wclrtoeol(wnd); wclrtoeol(wnd);
return; return;
} }
while (k--)
waddch(wnd, 'X');
wclrtoeol(wnd); wclrtoeol(wnd);
whline(wnd, 'X', k);
} }
void void

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.24 2000/04/11 01:01:26 jwise Exp $ */ /* $NetBSD: main.c,v 1.25 2000/06/04 18:29:13 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1992, 1993 * Copyright (c) 1980, 1992, 1993
@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1992, 1993\n\
#if 0 #if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif #endif
__RCSID("$NetBSD: main.c,v 1.24 2000/04/11 01:01:26 jwise Exp $"); __RCSID("$NetBSD: main.c,v 1.25 2000/06/04 18:29:13 mycroft Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -248,7 +248,7 @@ void
display(signo) display(signo)
int signo; int signo;
{ {
int i, j; int j;
sigset_t set; sigset_t set;
sigemptyset(&set); sigemptyset(&set);
@ -270,9 +270,9 @@ display(signo)
if (dellave < 0.1) if (dellave < 0.1)
c = '|'; c = '|';
dellave = avenrun[0]; dellave = avenrun[0];
wmove(wload, 0, 0); wclrtoeol(wload); wmove(wload, 0, 0);
for (i = (j > 50) ? 50 : j; i > 0; i--) wclrtoeol(wload);
waddch(wload, c); whline(wload, c, (j > 50) ? 50 : j);
if (j > 50) if (j > 50)
wprintw(wload, " %4.1f", avenrun[0]); wprintw(wload, " %4.1f", avenrun[0]);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbufs.c,v 1.7 1999/03/04 03:02:02 bgrayson Exp $ */ /* $NetBSD: mbufs.c,v 1.8 2000/06/04 18:29:13 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1992, 1993 * Copyright (c) 1980, 1992, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93"; static char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93";
#endif #endif
__RCSID("$NetBSD: mbufs.c,v 1.7 1999/03/04 03:02:02 bgrayson Exp $"); __RCSID("$NetBSD: mbufs.c,v 1.8 2000/06/04 18:29:13 mycroft Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -130,9 +130,8 @@ showmbufs()
waddch(wnd, 'X'); waddch(wnd, 'X');
waddstr(wnd, buf); waddstr(wnd, buf);
} else { } else {
while (max--)
waddch(wnd, 'X');
wclrtoeol(wnd); wclrtoeol(wnd);
whline(wnd, 'X', max);
} }
mb->m_mtypes[index] = 0; mb->m_mtypes[index] = 0;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: pigs.c,v 1.18 2000/06/04 16:06:26 thorpej Exp $ */ /* $NetBSD: pigs.c,v 1.19 2000/06/04 18:29:13 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1992, 1993 * Copyright (c) 1980, 1992, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)pigs.c 8.2 (Berkeley) 9/23/93"; static char sccsid[] = "@(#)pigs.c 8.2 (Berkeley) 9/23/93";
#endif #endif
__RCSID("$NetBSD: pigs.c,v 1.18 2000/06/04 16:06:26 thorpej Exp $"); __RCSID("$NetBSD: pigs.c,v 1.19 2000/06/04 18:29:13 mycroft Exp $");
#endif /* not lint */ #endif /* not lint */
/* /*
@ -101,7 +101,7 @@ closepigs(w)
void void
showpigs() showpigs()
{ {
int i, j, y, k; int i, y, k;
struct eproc *ep; struct eproc *ep;
float total; float total;
int factor; int factor;
@ -144,9 +144,7 @@ showpigs()
mvwaddstr(wnd, y, 9, pidstr); mvwaddstr(wnd, y, 9, pidstr);
(void)snprintf(pidname, sizeof(pidname), "%9.9s", pname); (void)snprintf(pidname, sizeof(pidname), "%9.9s", pname);
mvwaddstr(wnd, y, 15, pidname); mvwaddstr(wnd, y, 15, pidname);
wmove(wnd, y, 25); mvwhline(wnd, y, 25, 'X', pt[k].pt_pctcpu*factor + 0.5);
for (j = pt[k].pt_pctcpu*factor + 0.5; j > 0; j--)
waddch(wnd, 'X');
} }
wmove(wnd, y, 0); wclrtobot(wnd); wmove(wnd, y, 0); wclrtobot(wnd);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: swap.c,v 1.11 2000/04/13 08:29:56 mrg Exp $ */ /* $NetBSD: swap.c,v 1.12 2000/06/04 18:29:14 mycroft Exp $ */
/*- /*-
* Copyright (c) 1997 Matthew R. Green. All rights reserved. * Copyright (c) 1997 Matthew R. Green. All rights reserved.
@ -39,7 +39,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)swap.c 8.3 (Berkeley) 4/29/95"; static char sccsid[] = "@(#)swap.c 8.3 (Berkeley) 4/29/95";
#endif #endif
__RCSID("$NetBSD: swap.c,v 1.11 2000/04/13 08:29:56 mrg Exp $"); __RCSID("$NetBSD: swap.c,v 1.12 2000/06/04 18:29:14 mycroft Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -144,7 +144,7 @@ labelswap()
void void
showswap() { showswap() {
int col, div, i, j, avail, used, xsize, free; int col, div, i, avail, used, xsize, free;
struct swapent *sep; struct swapent *sep;
char *p; char *p;
@ -168,17 +168,15 @@ showswap() {
avail += xsize; avail += xsize;
free += xsize - used; free += xsize - used;
mvwprintw(wnd, i + 1, col, "%9d ", used / div); mvwprintw(wnd, i + 1, col, "%9d ", used / div);
for (j = (100 * used / xsize + 1) / 2; j > 0; j--)
waddch(wnd, 'X');
wclrtoeol(wnd); wclrtoeol(wnd);
whline(wnd, 'X', (100 * used / xsize + 1) / 2);
} }
/* do total if necessary */ /* do total if necessary */
if (nswap > 1) { if (nswap > 1) {
used = avail - free; used = avail - free;
mvwprintw(wnd, i + 1, 0, "%-5s%*d%9d ", mvwprintw(wnd, i + 1, 0, "%-5s%*d%9d ",
"Total", hlen, avail / div, used / div); "Total", hlen, avail / div, used / div);
for (j = (100 * used / avail + 1) / 2; j > 0; j--)
waddch(wnd, 'X');
wclrtoeol(wnd); wclrtoeol(wnd);
whline(wnd, 'X', (100 * used / avail + 1) / 2);
} }
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: vmstat.c,v 1.29 2000/06/04 18:14:45 mycroft Exp $ */ /* $NetBSD: vmstat.c,v 1.30 2000/06/04 18:29:14 mycroft Exp $ */
/*- /*-
* Copyright (c) 1983, 1989, 1992, 1993 * Copyright (c) 1983, 1989, 1992, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94"; static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#endif #endif
__RCSID("$NetBSD: vmstat.c,v 1.29 2000/06/04 18:14:45 mycroft Exp $"); __RCSID("$NetBSD: vmstat.c,v 1.30 2000/06/04 18:29:14 mycroft Exp $");
#endif /* not lint */ #endif /* not lint */
/* /*
@ -561,14 +561,12 @@ putint(n, l, c, w)
move(l, c); move(l, c);
if (n == 0) { if (n == 0) {
while (w-- > 0) hline(' ', w);
addch(' ');
return; return;
} }
(void)snprintf(b, sizeof b, "%*d", w, n); (void)snprintf(b, sizeof b, "%*d", w, n);
if (strlen(b) > w) { if (strlen(b) > w) {
while (w-- > 0) hline('*', w);
addch('*');
return; return;
} }
addstr(b); addstr(b);
@ -583,14 +581,12 @@ putfloat(f, l, c, w, d, nz)
move(l, c); move(l, c);
if (nz && f == 0.0) { if (nz && f == 0.0) {
while (--w >= 0) hline(' ', w);
addch(' ');
return; return;
} }
(void)snprintf(b, sizeof b, "%*.*f", w, d, f); (void)snprintf(b, sizeof b, "%*.*f", w, d, f);
if (strlen(b) > w) { if (strlen(b) > w) {
while (--w >= 0) hline('*', w);
addch('*');
return; return;
} }
addstr(b); addstr(b);