]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/format-table: use 'char*'-style in function signatures
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Mon, 23 Feb 2026 09:49:27 +0000 (10:49 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 6 Mar 2026 16:46:59 +0000 (17:46 +0100)
src/shared/format-table.c
src/shared/format-table.h

index 8b5b88370f13cedf3bf7b8bca17151b272a5bcb6..18cebf8628551ec46dbdde81c4644c227f55a122 100644 (file)
@@ -159,7 +159,7 @@ struct Table {
         bool *reverse_map;
 };
 
-Table *table_new_raw(size_t n_columns) {
+Tabletable_new_raw(size_t n_columns) {
         _cleanup_(table_unrefp) Table *t = NULL;
 
         assert(n_columns > 0);
@@ -179,7 +179,7 @@ Table *table_new_raw(size_t n_columns) {
         return TAKE_PTR(t);
 }
 
-Table *table_new_internal(const char *first_header, ...) {
+Tabletable_new_internal(const char *first_header, ...) {
         _cleanup_(table_unrefp) Table *t = NULL;
         size_t n_columns = 1;
         va_list ap;
@@ -216,7 +216,7 @@ Table *table_new_internal(const char *first_header, ...) {
         return TAKE_PTR(t);
 }
 
-Table *table_new_vertical(void) {
+Tabletable_new_vertical(void) {
         _cleanup_(table_unrefp) Table *t = NULL;
         TableCell *cell;
 
@@ -242,7 +242,7 @@ Table *table_new_vertical(void) {
         return TAKE_PTR(t);
 }
 
-static TableData *table_data_free(TableData *d) {
+static TableDatatable_data_free(TableData *d) {
         assert(d);
 
         free(d->formatted);
@@ -260,7 +260,7 @@ static TableData *table_data_free(TableData *d) {
 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) {
+Tabletable_unref(Table *t) {
         if (!t)
                 return NULL;
 
@@ -425,7 +425,7 @@ static bool table_data_matches(
         return memcmp_safe(data, d->data, l) == 0;
 }
 
-static TableData *table_data_new(
+static TableDatatable_data_new(
                 TableDataType type,
                 const void *data,
                 size_t minimum_width,
@@ -1602,7 +1602,7 @@ static char* format_strv_width(char **strv, size_t column_width) {
         return buf;
 }
 
-static const char *table_data_format(
+static const chartable_data_format(
                 Table *t,
                 TableData *d,
                 bool avoid_uppercasing,
@@ -2115,7 +2115,7 @@ static const char *table_data_format(
         return d->formatted;
 }
 
-static const char *table_data_format_strip_ansi(
+static const chartable_data_format_strip_ansi(
                 Table *t,
                 TableData *d,
                 bool avoid_uppercasing,
@@ -2252,7 +2252,7 @@ static int table_data_requested_width_height(
         return truncation_applied;
 }
 
-static char *align_string_mem(const char *str, const char *url, size_t new_length, unsigned percent) {
+static charalign_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;
@@ -2851,7 +2851,7 @@ int table_set_reverse(Table *t, size_t column, bool b) {
         return 0;
 }
 
-TableCell *table_get_cell(Table *t, size_t row, size_t column) {
+TableCelltable_get_cell(Table *t, size_t row, size_t column) {
         size_t i;
 
         assert(t);
@@ -2866,7 +2866,7 @@ 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) {
+const voidtable_get(Table *t, TableCell *cell) {
         TableData *d;
 
         assert(t);
@@ -3124,7 +3124,7 @@ static int table_make_json_field_name(Table *t, TableData *d, char **ret) {
         return 0;
 }
 
-static const char *table_get_json_field_name(Table *t, size_t idx) {
+static const chartable_get_json_field_name(Table *t, size_t idx) {
         assert(t);
 
         return idx < t->n_json_fields ? t->json_fields[idx] : NULL;
index ec9989c54c88a8cefb0217452fd54769e957aae3..997ac20eb6882dce0656f5b804d7fdbe4c73967f 100644 (file)
@@ -93,11 +93,11 @@ typedef enum TableErsatz {
 typedef struct Table Table;
 typedef struct TableCell TableCell;
 
-Table *table_new_internal(const char *first_header, ...) _sentinel_;
+Tabletable_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);
+Tabletable_new_raw(size_t n_columns);
+Tabletable_new_vertical(void);
+Tabletable_unref(Table *t);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC(Table*, table_unref);
 
@@ -159,10 +159,10 @@ size_t table_get_columns(Table *t);
 
 size_t table_get_current_column(Table *t);
 
-TableCell *table_get_cell(Table *t, size_t row, size_t column);
+TableCelltable_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 voidtable_get(Table *t, TableCell *cell);
+const voidtable_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);