assert(i);
- table = table_new("key", "value");
+ table = table_new_vertical();
if (!table)
return log_oom();
- table_set_header(table, false);
-
assert_se(cell = table_get_cell(table, 0, 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_ellipsize_percent(table, cell, 100);
n = have_time ? strftime(a, sizeof a, "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&sec, &tm)) : 0;
r = table_add_many(table,
- TABLE_STRING, "Local time:",
+ TABLE_FIELD, "Local time",
TABLE_STRING, n > 0 ? a : "n/a");
if (r < 0)
return table_log_add_error(r);
n = have_time ? strftime(a, sizeof a, "%a %Y-%m-%d %H:%M:%S UTC", gmtime_r(&sec, &tm)) : 0;
r = table_add_many(table,
- TABLE_STRING, "Universal time:",
+ TABLE_FIELD, "Universal time",
TABLE_STRING, n > 0 ? a : "n/a");
if (r < 0)
return table_log_add_error(r);
} else
n = 0;
r = table_add_many(table,
- TABLE_STRING, "RTC time:",
+ TABLE_FIELD, "RTC time",
TABLE_STRING, n > 0 ? a : "n/a");
if (r < 0)
return table_log_add_error(r);
- r = table_add_cell(table, NULL, TABLE_STRING, "Time zone:");
+ r = table_add_cell(table, NULL, TABLE_FIELD, "Time zone");
if (r < 0)
return table_log_add_error(r);
tzset();
r = table_add_many(table,
- TABLE_STRING, "System clock synchronized:",
+ TABLE_FIELD, "System clock synchronized",
TABLE_BOOLEAN, i->ntp_synced,
- TABLE_STRING, "NTP service:",
+ TABLE_FIELD, "NTP service",
TABLE_STRING, i->ntp_capable ? (i->ntp_active ? "active" : "inactive") : "n/a",
- TABLE_STRING, "RTC in local TZ:",
+ TABLE_FIELD, "RTC in local TZ",
TABLE_BOOLEAN, i->rtc_local);
if (r < 0)
return table_log_add_error(r);
assert(i);
- table = table_new("key", "value");
+ table = table_new_vertical();
if (!table)
return log_oom();
- table_set_header(table, false);
-
assert_se(cell = table_get_cell(table, 0, 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_ellipsize_percent(table, cell, 100);
* d = (T4 - T1) - (T3 - T2) t = ((T2 - T1) + (T3 - T4)) / 2"
*/
- r = table_add_cell(table, NULL, TABLE_STRING, "Server:");
+ r = table_add_cell(table, NULL, TABLE_FIELD, "Server");
if (r < 0)
return table_log_add_error(r);
if (r < 0)
return table_log_add_error(r);
- r = table_add_cell(table, NULL, TABLE_STRING, "Poll interval:");
+ r = table_add_cell(table, NULL, TABLE_FIELD, "Poll interval");
if (r < 0)
return table_log_add_error(r);
if (i->packet_count == 0) {
r = table_add_many(table,
- TABLE_STRING, "Packet count:",
+ TABLE_FIELD, "Packet count",
TABLE_STRING, "0");
if (r < 0)
return table_log_add_error(r);
root_distance = i->root_delay / 2 + i->root_dispersion;
r = table_add_many(table,
- TABLE_STRING, "Leap:",
+ TABLE_FIELD, "Leap",
TABLE_STRING, ntp_leap_to_string(i->leap),
- TABLE_STRING, "Version:",
+ TABLE_FIELD, "Version",
TABLE_UINT32, i->version,
- TABLE_STRING, "Stratum:",
+ TABLE_FIELD, "Stratum",
TABLE_UINT32, i->stratum,
- TABLE_STRING, "Reference:");
+ TABLE_FIELD, "Reference");
if (r < 0)
return table_log_add_error(r);
if (r < 0)
return table_log_add_error(r);
- r = table_add_cell(table, NULL, TABLE_STRING, "Precision:");
+ r = table_add_cell(table, NULL, TABLE_FIELD, "Precision");
if (r < 0)
return table_log_add_error(r);
if (r < 0)
return table_log_add_error(r);
- r = table_add_cell(table, NULL, TABLE_STRING, "Root distance:");
+ r = table_add_cell(table, NULL, TABLE_FIELD, "Root distance");
if (r < 0)
return table_log_add_error(r);
if (r < 0)
return table_log_add_error(r);
- r = table_add_cell(table, NULL, TABLE_STRING, "Offset:");
+ r = table_add_cell(table, NULL, TABLE_FIELD, "Offset");
if (r < 0)
return table_log_add_error(r);
return table_log_add_error(r);
r = table_add_many(table,
- TABLE_STRING, "Delay:",
+ TABLE_FIELD, "Delay",
TABLE_STRING, FORMAT_TIMESPAN(delay, 0),
- TABLE_STRING, "Jitter:",
+ TABLE_FIELD, "Jitter",
TABLE_STRING, FORMAT_TIMESPAN(i->jitter, 0),
- TABLE_STRING, "Packet count:",
+ TABLE_FIELD, "Packet count",
TABLE_UINT64, i->packet_count);
if (r < 0)
return table_log_add_error(r);
if (!i->spike) {
- r = table_add_cell(table, NULL, TABLE_STRING, "Frequency:");
+ r = table_add_cell(table, NULL, TABLE_FIELD, "Frequency");
if (r < 0)
return table_log_add_error(r);