diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-11-09 11:38:12 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-11-30 16:46:10 +0100 |
commit | 62d99b39709f903f8a66a9aae757deb5546a53eb (patch) | |
tree | 91b3611f78de0c1e17b1f245a7a256d9c11f72a1 /src/shared/format-table.c | |
parent | 30d98de00c68440ff4d77d851b4b3323c34027da (diff) | |
download | systemd-62d99b39709f903f8a66a9aae757deb5546a53eb.tar.gz |
format-table: add calls to query the data in a specific cell
Diffstat (limited to 'src/shared/format-table.c')
-rw-r--r-- | src/shared/format-table.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/shared/format-table.c b/src/shared/format-table.c index b5af0f5fe0..8189c3475d 100644 --- a/src/shared/format-table.c +++ b/src/shared/format-table.c @@ -1392,3 +1392,25 @@ TableCell *table_get_cell(Table *t, size_t row, size_t column) { return TABLE_INDEX_TO_CELL(i); } + +const void *table_get(Table *t, TableCell *cell) { + TableData *d; + + assert(t); + + d = table_get_data(t, cell); + if (!d) + return NULL; + + return d->data; +} + +const void* table_get_at(Table *t, size_t row, size_t column) { + TableCell *cell; + + cell = table_get_cell(t, row, column); + if (!cell) + return NULL; + + return table_get(t, cell); +} |