bool *reverse_map;
};
-Table *table_new_raw(size_t n_columns) {
+Table* table_new_raw(size_t n_columns) {
_cleanup_(table_unrefp) Table *t = NULL;
assert(n_columns > 0);
return TAKE_PTR(t);
}
-Table *table_new_internal(const char *first_header, ...) {
+Table* table_new_internal(const char *first_header, ...) {
_cleanup_(table_unrefp) Table *t = NULL;
size_t n_columns = 1;
va_list ap;
return TAKE_PTR(t);
}
-Table *table_new_vertical(void) {
+Table* table_new_vertical(void) {
_cleanup_(table_unrefp) Table *t = NULL;
TableCell *cell;
return TAKE_PTR(t);
}
-static TableData *table_data_free(TableData *d) {
+static TableData* table_data_free(TableData *d) {
assert(d);
free(d->formatted);
DEFINE_PRIVATE_TRIVIAL_REF_UNREF_FUNC(TableData, table_data, table_data_free);
DEFINE_TRIVIAL_CLEANUP_FUNC(TableData*, table_data_unref);
-Table *table_unref(Table *t) {
+Table* table_unref(Table *t) {
if (!t)
return NULL;
return memcmp_safe(data, d->data, l) == 0;
}
-static TableData *table_data_new(
+static TableData* table_data_new(
TableDataType type,
const void *data,
size_t minimum_width,
return buf;
}
-static const char *table_data_format(
+static const char* table_data_format(
Table *t,
TableData *d,
bool avoid_uppercasing,
return d->formatted;
}
-static const char *table_data_format_strip_ansi(
+static const char* table_data_format_strip_ansi(
Table *t,
TableData *d,
bool avoid_uppercasing,
return truncation_applied;
}
-static char *align_string_mem(const char *str, const char *url, size_t new_length, unsigned percent) {
+static char* align_string_mem(const char *str, const char *url, size_t new_length, unsigned percent) {
size_t w = 0, space, lspace, old_length, clickable_length;
_cleanup_free_ char *clickable = NULL;
const char *p;
return 0;
}
-TableCell *table_get_cell(Table *t, size_t row, size_t column) {
+TableCell* table_get_cell(Table *t, size_t row, size_t column) {
size_t i;
assert(t);
return TABLE_INDEX_TO_CELL(i);
}
-const void *table_get(Table *t, TableCell *cell) {
+const void* table_get(Table *t, TableCell *cell) {
TableData *d;
assert(t);
return 0;
}
-static const char *table_get_json_field_name(Table *t, size_t idx) {
+static const char* table_get_json_field_name(Table *t, size_t idx) {
assert(t);
return idx < t->n_json_fields ? t->json_fields[idx] : NULL;
typedef struct Table Table;
typedef struct TableCell TableCell;
-Table *table_new_internal(const char *first_header, ...) _sentinel_;
+Table* table_new_internal(const char *first_header, ...) _sentinel_;
#define table_new(...) table_new_internal(__VA_ARGS__, NULL)
-Table *table_new_raw(size_t n_columns);
-Table *table_new_vertical(void);
-Table *table_unref(Table *t);
+Table* table_new_raw(size_t n_columns);
+Table* table_new_vertical(void);
+Table* table_unref(Table *t);
DEFINE_TRIVIAL_CLEANUP_FUNC(Table*, table_unref);
size_t table_get_current_column(Table *t);
-TableCell *table_get_cell(Table *t, size_t row, size_t column);
+TableCell* table_get_cell(Table *t, size_t row, size_t column);
-const void *table_get(Table *t, TableCell *cell);
-const void *table_get_at(Table *t, size_t row, size_t column);
+const void* table_get(Table *t, TableCell *cell);
+const void* table_get_at(Table *t, size_t row, size_t column);
int table_to_json(Table *t, sd_json_variant **ret);
int table_print_json(Table *t, FILE *f, sd_json_format_flags_t json_flags);