Get rid of DSIZ; instead just call the sizing function if provided.
This commit is contained in:
parent
ac6518673e
commit
649fde88ff
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=220574
@ -79,9 +79,9 @@ static VAR var[] = {
|
||||
CHAR, NULL, 0},
|
||||
{"blocked", "", "sigmask", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
{"caught", "", "sigcatch", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
{"class", "CLASS", NULL, LJUST|DSIZ, loginclass, s_loginclass,
|
||||
{"class", "CLASS", NULL, LJUST, loginclass, s_loginclass,
|
||||
MAXLOGNAME-1, 0, CHAR, NULL, 0},
|
||||
{"comm", "COMMAND", NULL, LJUST|DSIZ, ucomm, s_comm,
|
||||
{"comm", "COMMAND", NULL, LJUST, ucomm, s_comm,
|
||||
COMMLEN + OCOMMLEN + 1, 0, CHAR, NULL, 0},
|
||||
{"command", "COMMAND", NULL, COMM|LJUST|USER, command, NULL, 16, 0,
|
||||
CHAR, NULL, 0},
|
||||
@ -103,12 +103,12 @@ static VAR var[] = {
|
||||
0},
|
||||
{"ktrace", "KTRACE", NULL, 0, kvar, NULL, 8, KOFF(ki_traceflag), INT,
|
||||
"x", 0},
|
||||
{"label", "LABEL", NULL, LJUST|DSIZ, label, s_label, SHRT_MAX, 0, CHAR,
|
||||
{"label", "LABEL", NULL, LJUST, label, s_label, SHRT_MAX, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"lim", "LIM", NULL, 0, maxrss, NULL, 5, 0, CHAR, NULL, 0},
|
||||
{"lockname", "LOCK", NULL, LJUST, lockname, NULL, 6, 0, CHAR, NULL,
|
||||
0},
|
||||
{"login", "LOGIN", NULL, LJUST|DSIZ, logname, s_logname, MAXLOGNAME-1,
|
||||
{"login", "LOGIN", NULL, LJUST, logname, s_logname, MAXLOGNAME-1,
|
||||
0, CHAR, NULL, 0},
|
||||
{"logname", "", "login", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
{"lstart", "STARTED", NULL, LJUST|USER, lstarted, NULL, 28, 0, CHAR,
|
||||
@ -160,14 +160,14 @@ static VAR var[] = {
|
||||
0},
|
||||
{"rgid", "RGID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_rgid),
|
||||
UINT, UIDFMT, 0},
|
||||
{"rgroup", "RGROUP", NULL, LJUST|DSIZ, rgroupname, s_rgroupname,
|
||||
{"rgroup", "RGROUP", NULL, LJUST, rgroupname, s_rgroupname,
|
||||
USERLEN, 0, CHAR, NULL, 0},
|
||||
{"rss", "RSS", NULL, 0, kvar, NULL, 6, KOFF(ki_rssize), PGTOK, "ld", 0},
|
||||
{"rtprio", "RTPRIO", NULL, 0, priorityr, NULL, 7, KOFF(ki_pri), CHAR,
|
||||
NULL, 0},
|
||||
{"ruid", "RUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_ruid),
|
||||
UINT, UIDFMT, 0},
|
||||
{"ruser", "RUSER", NULL, LJUST|DSIZ, runame, s_runame, USERLEN,
|
||||
{"ruser", "RUSER", NULL, LJUST, runame, s_runame, USERLEN,
|
||||
0, CHAR, NULL, 0},
|
||||
{"sid", "SID", NULL, 0, kvar, NULL, PIDLEN, KOFF(ki_sid), UINT,
|
||||
PIDFMT, 0},
|
||||
@ -189,13 +189,13 @@ static VAR var[] = {
|
||||
UINT, UIDFMT, 0},
|
||||
{"svuid", "SVUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svuid),
|
||||
UINT, UIDFMT, 0},
|
||||
{"systime", "SYSTIME", NULL, USER|DSIZ, systime, s_systime, 15, 0, CHAR,
|
||||
{"systime", "SYSTIME", NULL, USER, systime, s_systime, 15, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"tdaddr", "TDADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2,
|
||||
KOFF(ki_tdaddr), KPTR, "lx", 0},
|
||||
{"tdev", "TDEV", NULL, 0, tdev, NULL, 5, 0, CHAR, NULL, 0},
|
||||
{"tdnam", "TDNAM", NULL, LJUST, tdnam, NULL, COMMLEN, 0, CHAR, NULL, 0},
|
||||
{"time", "TIME", NULL, USER|DSIZ, cputime, s_cputime, 15, 0, CHAR,
|
||||
{"time", "TIME", NULL, USER, cputime, s_cputime, 15, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"tpgid", "TPGID", NULL, 0, kvar, NULL, 4, KOFF(ki_tpgid), UINT,
|
||||
PIDFMT, 0},
|
||||
@ -204,16 +204,16 @@ static VAR var[] = {
|
||||
{"tsiz", "TSIZ", NULL, 0, kvar, NULL, 4, KOFF(ki_tsize), PGTOK, "ld", 0},
|
||||
{"tt", "TT ", NULL, 0, tname, NULL, 4, 0, CHAR, NULL, 0},
|
||||
{"tty", "TTY", NULL, LJUST, longtname, NULL, 8, 0, CHAR, NULL, 0},
|
||||
{"ucomm", "UCOMM", NULL, LJUST|DSIZ, ucomm, s_comm,
|
||||
{"ucomm", "UCOMM", NULL, LJUST, ucomm, s_comm,
|
||||
COMMLEN + OCOMMLEN + 1, 0, CHAR, NULL, 0},
|
||||
{"uid", "UID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_uid), UINT,
|
||||
UIDFMT, 0},
|
||||
{"upr", "UPR", NULL, 0, upr, NULL, 3, 0, CHAR, NULL, 0},
|
||||
{"uprocp", "UPROCP", NULL, 0, kvar, NULL, sizeof(void *) * 2,
|
||||
KOFF(ki_paddr), KPTR, "lx", 0},
|
||||
{"user", "USER", NULL, LJUST|DSIZ, uname, s_uname, USERLEN, 0, CHAR,
|
||||
{"user", "USER", NULL, LJUST, uname, s_uname, USERLEN, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"usertime", "USERTIME", NULL, USER|DSIZ, usertime, s_usertime, 15, 0,
|
||||
{"usertime", "USERTIME", NULL, USER, usertime, s_usertime, 15, 0,
|
||||
CHAR, NULL, 0},
|
||||
{"usrpri", "", "upr", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
{"vsize", "", "vsz", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
|
||||
|
@ -1078,7 +1078,7 @@ scanvars(void)
|
||||
|
||||
STAILQ_FOREACH(vent, &varlist, next_ve) {
|
||||
v = vent->var;
|
||||
if (v->flag & DSIZ) {
|
||||
if (v->sproc != NULL) {
|
||||
v->dwidth = v->width;
|
||||
v->width = 0;
|
||||
}
|
||||
@ -1098,7 +1098,7 @@ dynsizevars(KINFO *ki)
|
||||
|
||||
STAILQ_FOREACH(vent, &varlist, next_ve) {
|
||||
v = vent->var;
|
||||
if (!(v->flag & DSIZ))
|
||||
if (v->sproc == NULL)
|
||||
continue;
|
||||
i = (v->sproc)(ki);
|
||||
if (v->width < i)
|
||||
|
@ -62,7 +62,6 @@ typedef struct var {
|
||||
#define COMM 0x01 /* needs exec arguments and environment (XXX) */
|
||||
#define LJUST 0x02 /* left adjust on output (trailing blanks) */
|
||||
#define USER 0x04 /* needs user structure */
|
||||
#define DSIZ 0x08 /* field size is dynamic*/
|
||||
#define INF127 0x10 /* values >127 displayed as 127 */
|
||||
u_int flag;
|
||||
/* output routine */
|
||||
|
Loading…
Reference in New Issue
Block a user