Lines Matching refs:which
267 short which, len, reverse; member
403 int which = field->which, sl = typos[which].slot; in string_field() local
407 if (which <= PS_CPU) { in string_field()
410 if (which==PS_PRI) ll = 39-ll; in string_field()
411 if (which==PS_ADDR) fmt = "%llx"; in string_field()
412 else if (which==PS_SZ) ll >>= 12; in string_field()
413 else if (which==PS_RSS) ll <<= 2; in string_field()
414 else if (which==PS_VSZ) ll >>= 10; in string_field()
415 else if (which==PS_PR && ll<-9) fmt="RT"; in string_field()
416 else if (which==PS_RTPRIO && ll == 0) fmt="-"; in string_field()
422 tb->str[tb->offset[4]+slot[SLOT_argv0len]] = (which==PS_NAME) ? 0 : ' '; in string_field()
426 if (which==PS_ARGS) in string_field()
428 if (which>=PS_COMMAND && !*out) sprintf(out = buf, "[%s]", tb->str); in string_field()
431 } else if (which <= PS_RGROUP) { in string_field()
434 if (which > PS_RUSER) { in string_field()
446 } else if (which <= PS_TIME_) { in string_field()
450 if (which!=PS_TIME_) unit *= 60*24; in string_field()
453 if (which==PS_ELAPSED) ll = (slot[SLOT_uptime]*j)-slot[SLOT_starttime]; in string_field()
458 for (s = 0, j = 2*(which==PS_TIME_); j<4; j++) { in string_field()
459 if (!s && (seconds>unit || j == 1+(which!=PS_TIME))) s = out; in string_field()
468 if (which==PS_TIME_ && s-out<8) in string_field()
472 } else if (which <= PS__CPU) { in string_field()
474 if (which==PS__VSZ || which==PS__MEM) in string_field()
475 ll /= TT.si.totalram/((which==PS__VSZ) ? 1024 : 4096); in string_field()
478 if (which==PS_C) sl += 5; in string_field()
480 if (which!=PS_C && sl<1000) sprintf(out+strlen(out), ".%d", sl%10); in string_field()
483 } else if (which <= PS_DIO) { in string_field()
484 ll = slot[typos[which].slot]; in string_field()
485 if (which <= PS_SHR) ll *= sysconf(_SC_PAGESIZE); in string_field()
491 } else if (which==PS_F) sprintf(out, "%llo", (slot[SLOT_flags]>>6)&5); in string_field()
492 else if (which==PS_S || which==PS_STAT) { in string_field()
495 if (which==PS_STAT) { in string_field()
504 } else if (which==PS_STIME) { in string_field()
515 } else if (CFG_TOYBOX_DEBUG) error_exit("bad which %d", which); in string_field()
812 field->which = i; in parse_ko()
826 if (!field->title) field->title = typos[field->which].name; in parse_ko()
827 if (!field->len) field->len = typos[field->which].width; in parse_ko()
828 else if (typos[field->which].width<0) field->len *= -1; in parse_ko()
842 bits |= 1LL<<fields->which; in get_headers()
932 slot = typos[field->which].slot; in ksort()
990 TT.width = (toys.which->name[1] == 's') ? 99999 : 80; in shared_main()
1049 if ((toys.optflags&FLAG_f) && ever->which==PS_CMD) ever->which = PS_ARGS; in ps_main()
1050 if ((toys.optflags&FLAG_n) && ever->which>=PS_UID in ps_main()
1051 && ever->which<=PS_RGROUP && (typos[ever->which].slot&64)) in ps_main()
1052 ever->which--; in ps_main()
1120 going2->which = field->which; in setsort()
1256 if (*toys.which->name == 't') { in top_common()
1262 alluc.which = PS_S; in top_common()
1315 int slot = typos[fields->which].slot&63; in top_common()
1317 if (fields->which<PS_C || fields->which>PS_DIO) continue; in top_common()
1318 ll = 1LL<<fields->which; in top_common()
1324 " %s: %*s,", typos[fields->which].name, in top_common()