assert_se(cell = table_get_cell(table, 0, 0));
(void) table_set_minimum_width(table, cell, 3);
(void) table_set_weight(table, cell, 0);
- (void) table_set_ellipsize_percent(table, cell, 0);
+ (void) table_set_ellipsize_percent(table, cell, 100);
(void) table_set_align_percent(table, cell, 100);
assert_se(cell = table_get_cell(table, 0, 1));
- (void) table_set_minimum_width(table, cell, 16);
-
- assert_se(cell = table_get_cell(table, 0, 2));
- (void) table_set_minimum_width(table, cell, 18);
-
- assert_se(cell = table_get_cell(table, 0, 3));
- (void) table_set_minimum_width(table, cell, 16);
-
- assert_se(cell = table_get_cell(table, 0, 4));
- (void) table_set_minimum_width(table, cell, 10);
+ (void) table_set_ellipsize_percent(table, cell, 100);
for (i = 0; i < c; i++) {
_cleanup_free_ char *setup_state = NULL, *operational_state = NULL;
t = link_get_type_string(links[i].iftype, d);
- r = table_add_cell_full(table, NULL, TABLE_INT, &links[i].ifindex, SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_INT, &links[i].ifindex);
if (r < 0)
return r;
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, i == 0 ? "Gateway:" : "", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, i == 0 ? "Gateway:" : "");
if (r < 0)
return r;
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, i == 0 ? "Address:" : "", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, i == 0 ? "Address:" : "");
if (r < 0)
return r;
assert_se(cell = table_get_cell(table, 0, 0));
(void) table_set_align_percent(table, cell, 100);
+ (void) table_set_ellipsize_percent(table, cell, 100);
assert_se(cell = table_get_cell(table, 0, 1));
(void) table_set_align_percent(table, cell, 100);
if (r < 0)
continue;
- r = table_add_cell_full(table, NULL, TABLE_UINT32, &label, SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_UINT32, &label);
if (r < 0)
return r;
r = table_add_cell_stringf(table, &cell, "%s/%u", pretty, prefixlen);
if (r < 0)
return r;
-
- (void) table_set_align_percent(table, cell, 100);
}
return table_print(table, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, c == 0 ? prefix : "", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, c == 0 ? prefix : "");
if (r < 0)
return r;
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, c == 0 ? prefix : "", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, c == 0 ? prefix : "");
if (r < 0)
return r;
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, i == l ? prefix : "", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, i == l ? prefix : "");
if (r < 0)
return r;
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL); \
if (r < 0) \
return r; \
- r = table_add_cell_full(table, NULL, TABLE_STRING, name ":", \
- SIZE_MAX, SIZE_MAX, 0, 100, 0); \
+ r = table_add_cell(table, NULL, TABLE_STRING, name ":"); \
if (r < 0) \
return r; \
r = table_add_cell(table, NULL, info->has_stats64 ? TABLE_UINT64 : TABLE_UINT32, \
if (!table)
return -ENOMEM;
+ assert_se(cell = table_get_cell(table, 0, 0));
+ (void) table_set_ellipsize_percent(table, cell, 100);
+
+ assert_se(cell = table_get_cell(table, 0, 1));
+ (void) table_set_ellipsize_percent(table, cell, 100);
+
table_set_header(table, false);
r = table_add_cell(table, &cell, TABLE_STRING, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE));
if (r < 0)
return r;
- (void) table_set_ellipsize_percent(table, cell, 0);
(void) table_set_color(table, cell, on_color_operational);
- r = table_add_cell_stringf(table, NULL, "%i: %s", info->ifindex, info->name);
+ r = table_add_cell_stringf(table, &cell, "%i: %s", info->ifindex, info->name);
if (r < 0)
return r;
+ (void) table_set_align_percent(table, cell, 0);
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "Link File:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, &cell, TABLE_STRING, "Link File:");
if (r < 0)
return r;
+ (void) table_set_align_percent(table, cell, 100);
r = table_add_cell(table, NULL, TABLE_STRING, strna(link));
if (r < 0)
return r;
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "Network File:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "Network File:");
if (r < 0)
return r;
r = table_add_cell(table, NULL, TABLE_STRING, strna(network));
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "Type:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "Type:");
if (r < 0)
return r;
r = table_add_cell(table, NULL, TABLE_STRING, strna(t));
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "State:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "State:");
if (r < 0)
return r;
r = table_add_cell_stringf(table, NULL, "%s%s%s (%s%s%s)",
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "Path:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "Path:");
if (r < 0)
return r;
r = table_add_cell(table, NULL, TABLE_STRING, path);
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "Driver:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "Driver:");
if (r < 0)
return r;
r = table_add_cell(table, NULL, TABLE_STRING, driver);
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "Vendor:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "Vendor:");
if (r < 0)
return r;
r = table_add_cell(table, NULL, TABLE_STRING, vendor);
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "Model:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "Model:");
if (r < 0)
return r;
r = table_add_cell(table, NULL, TABLE_STRING, model);
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "HW Address:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "HW Address:");
if (r < 0)
return r;
r = table_add_cell_stringf(table, NULL, "%s%s%s%s",
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "MTU:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "MTU:");
if (r < 0)
return r;
r = table_add_cell_stringf(table, NULL, "%" PRIu32 "%s%s%s%s%s%s%s",
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "Bit Rate (Tx/Rx):", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "Bit Rate (Tx/Rx):");
if (r < 0)
return r;
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "Queue Length (Tx/Rx):", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "Queue Length (Tx/Rx):");
if (r < 0)
return r;
r = table_add_cell_stringf(table, NULL, "%" PRIu32 "/%" PRIu32, info->tx_queues, info->rx_queues);
r = table_add_cell(table, NULL, TABLE_EMPTY, NULL);
if (r < 0)
return r;
- r = table_add_cell_full(table, NULL, TABLE_STRING, "Time Zone:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "Time Zone:");
if (r < 0)
return r;
r = table_add_cell(table, NULL, TABLE_STRING, tz);
if (!table)
return -ENOMEM;
+ assert_se(cell = table_get_cell(table, 0, 0));
+ (void) table_set_ellipsize_percent(table, cell, 100);
+
+ assert_se(cell = table_get_cell(table, 0, 1));
+ (void) table_set_align_percent(table, cell, 100);
+ (void) table_set_ellipsize_percent(table, cell, 100);
+
table_set_header(table, false);
r = table_add_cell(table, &cell, TABLE_STRING, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE));
if (r < 0)
return r;
(void) table_set_color(table, cell, on_color_operational);
- (void) table_set_ellipsize_percent(table, cell, 0);
- r = table_add_cell_full(table, NULL, TABLE_STRING, "State:", SIZE_MAX, SIZE_MAX, 0, 100, 0);
+ r = table_add_cell(table, NULL, TABLE_STRING, "State:");
if (r < 0)
return r;