Lines Matching defs:field
11 * Posix says default output should have field named "TTY" but if you "-o tty"
12 * the same field should be called "TT" which is _INSANE_ and I'm not doing it.
21 * field always prints "-" with an alignment of 1, which is why it has 11
76 -k Sort FIELDs (-FIELD to reverse) -M Measure/pad future field widths
99 -s Sort by field number (1-X, default 9)
128 -s Sort by field number (0-X, default 6)
299 * slot: which slot[] out of procpid. Negative means it's a string field.
434 // Print help text for each -o field, with categories.
445 printf("Command line field types:\n\n");
451 printf("\nProcess attribute field types:\n\n");
502 static char *string_field(struct procpid *tb, struct ofields *field)
505 int which = field->which, sl = typos[which].slot;
591 int i = abs(field->len);
622 // Padding behavior's a bit odd: default field size is just hh:mm.
627 out = out+strlen(out)-3-abs(field->len);
640 struct ofields *field;
644 for (field = TT.fields; field; field = field->next) {
645 char *out = string_field(tb, field);
647 // Output the field, appropriately padded
649 // Minimum one space between each field
651 if (field != TT.fields) {
658 abslen = abs(field->len);
659 sign = field->len<0 ? -1 : 1;
661 if ((field->which<=PS_BIT || FLAG(w)) && olen>abslen) {
677 // If last field is left justified, no trailing spaces.
678 if (!field->next && sign<0) {
683 // If we truncated a left-justified field, show + instead of last char
687 if (field->next) pad++;
706 long long bits; // Only fetch extra data if an -o field is displaying it
743 // parse oddball fields: the first field is same as new->name (skip it)
830 // Skip redundant RSS field, we got it from stat.
860 // and what -o display field outputs it (to skip the ones we don't need).
1056 struct ofields *field;
1081 field = xzalloc(sizeof(struct ofields)+(length+1)*!!title);
1083 memcpy(field->title = (char *)(field+1), title, length);
1084 field->title[field->len = length] = 0;
1088 field->len = strtol(++width, &title, 10);
1094 field->reverse = 1;
1095 if (*type == '-') field->reverse = -1;
1099 field->which = i;
1113 if (!field->title) field->title = typos[field->which].name;
1114 if (!field->len) field->len = typos[field->which].width;
1115 else if (typos[field->which].width<0) field->len *= -1;
1116 dlist_add_nomalloc(data, (void *)field);
1123 static long long get_headers(struct ofields *field, char *buf, int blen)
1128 for (; field; field = field->next) {
1129 len += snprintf(buf+len, blen-len, " %*s"+!bits, field->len,
1130 field->title);
1131 bits |= 1LL<<field->which;
1218 struct ofields *field;
1222 for (field = TT.kfields; field && !ret; field = field->next) {
1223 slot = typos[field->which].slot;
1233 memccpy(toybuf, string_field(ta, field), 0, 2048);
1235 ret = strcmp(toybuf, string_field(tb, field));
1237 ret *= field->reverse;
1243 // Collect ->extra field from leaf nodes DIRTREE_SAVEd by get_ps() into array
1344 struct ofields *field;
1346 for (field = TT.fields; field; field = field->next) {
1347 if (FLAG(n) && field->which>=PS_UID
1348 && field->which<=PS_RGROUP && (typos[field->which].slot&XX))
1349 field->which--;
1368 struct ofields *field;
1370 for (field = TT.fields; field; field = field->next) {
1371 int len = strlen(string_field(tbsort[i], field));
1373 if (abs(field->len)<len) field->len = (field->len<0) ? -len : len;
1377 // Now that we've recalculated field widths, re-pad headers again
1410 struct ofields *field, *field2;
1415 for (field = TT.fields; field; field = field->next) {
1416 if ((TT.sortpos = i++)<pos && field->next) continue;
1418 field2->which = field->which;
1419 field2->len = field->len;
1567 struct ofields field;
1578 field.which = PS_S;
1581 run[1+stridx("RTtZ", *string_field(mix.tb[i], &field))]++;
1629 struct ofields *field;
1634 for (field = TT.fields; field; field = field->next) {
1636 int slot = typos[field->which].slot&(XX-1);
1638 if (field->which<PS_C || field->which>PS_DIO) continue;
1639 ll = 1LL<<field->which;
1645 " %s: %*s,", typos[field->which].name,
1646 field->len, string_field(&tb, field));
1758 // First (dummy) sort field is overwritten by setsort()
1773 struct ofields *field = TT.fields;
1775 field = field->next->next;
1776 comma_args(TT.top.O, &field, "bad -O", parse_ko);
1864 // Repurpose a field for -c count.