summaryrefslogtreecommitdiff
path: root/src/shared/format-table.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-07-29 20:44:54 +0200
committerGitHub <noreply@github.com>2019-07-29 20:44:54 +0200
commitcd2d52d34f280553c099e15a99a2e2751ef89826 (patch)
treefebf7c8b6afbbae72d9ac34b9d94ccedb5bd25cf /src/shared/format-table.h
parentb8011ae2f89bbd131f5348f162f23c01865669b3 (diff)
parent81896fa2d92527038e072f4625ca3629bc6c63e8 (diff)
downloadsystemd-cd2d52d34f280553c099e15a99a2e2751ef89826.tar.gz
Merge pull request #13216 from poettering/busctl-format-table
port "busctl list" to format-table.h
Diffstat (limited to 'src/shared/format-table.h')
-rw-r--r--src/shared/format-table.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/shared/format-table.h b/src/shared/format-table.h
index c6df8bf70c..aacf978978 100644
--- a/src/shared/format-table.h
+++ b/src/shared/format-table.h
@@ -49,6 +49,10 @@ typedef enum TableDataType {
_TABLE_DATA_TYPE_INVALID = -1,
} TableDataType;
+/* PIDs are just 32bit signed integers on Linux */
+#define TABLE_PID TABLE_INT32
+assert_cc(sizeof(pid_t) == sizeof(int32_t));
+
typedef struct Table Table;
typedef struct TableCell TableCell;
@@ -65,6 +69,8 @@ static inline int table_add_cell(Table *t, TableCell **ret_cell, TableDataType t
}
int table_add_cell_stringf(Table *t, TableCell **ret_cell, const char *format, ...) _printf_(3, 4);
+int table_fill_empty(Table *t, size_t until_column);
+
int table_dup_cell(Table *t, TableCell *cell);
int table_set_minimum_width(Table *t, TableCell *cell, size_t minimum_width);
@@ -83,6 +89,7 @@ int table_add_many_internal(Table *t, TableDataType first_type, ...);
void table_set_header(Table *table, bool b);
void table_set_width(Table *t, size_t width);
+int table_set_empty_string(Table *t, const char *empty);
int table_set_display(Table *t, size_t first_column, ...);
int table_set_sort(Table *t, size_t first_column, ...);
int table_set_reverse(Table *t, size_t column, bool b);