chiark / gitweb /
Prep v239: Mask all unneeded functions in the new format-table.[hc] files.
authorSven Eden <yamakuzure@gmx.net>
Thu, 23 Aug 2018 06:20:10 +0000 (08:20 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
src/basic/format-table.c
src/basic/format-table.h
src/basic/meson.build
src/test/test-format-table.c

index 6c079bf8d563c6fea96007da111953d77f688d07..00473a2e8c52630253a96935ea5c1314b4650eca 100644 (file)
@@ -1,18 +1,18 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-//#include <stdio_ext.h>
-
-//#include "alloc-util.h"
-//#include "fd-util.h"
-//#include "fileio.h"
-//#include "format-table.h"
-//#include "gunicode.h"
-//#include "pager.h"
-//#include "parse-util.h"
-//#include "string-util.h"
-//#include "terminal-util.h"
-//#include "time-util.h"
-//#include "utf8.h"
+#include <stdio_ext.h>
+
+#include "alloc-util.h"
+#include "fd-util.h"
+#include "fileio.h"
+#include "format-table.h"
+#include "gunicode.h"
+#include "pager.h"
+#include "parse-util.h"
+#include "string-util.h"
+#include "terminal-util.h"
+#include "time-util.h"
+#include "utf8.h"
 #include "util.h"
 
 #define DEFAULT_WEIGHT 100
@@ -373,6 +373,7 @@ int table_add_cell_full(
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 int table_dup_cell(Table *t, TableCell *cell) {
         size_t i;
 
@@ -390,6 +391,7 @@ int table_dup_cell(Table *t, TableCell *cell) {
         t->data[t->n_cells++] = table_data_ref(t->data[i]);
         return 0;
 }
+#endif // 0
 
 static int table_dedup_cell(Table *t, TableCell *cell) {
         TableData *nd, *od;
@@ -440,6 +442,7 @@ static TableData *table_get_data(Table *t, TableCell *cell) {
         return t->data[i];
 }
 
+#if 0 /// UNNEEDED by elogind
 int table_set_minimum_width(Table *t, TableCell *cell, size_t minimum_width) {
         int r;
 
@@ -487,6 +490,7 @@ int table_set_weight(Table *t, TableCell *cell, unsigned weight) {
         table_get_data(t, cell)->weight = weight;
         return 0;
 }
+#endif // 0
 
 int table_set_align_percent(Table *t, TableCell *cell, unsigned percent) {
         int r;
@@ -507,6 +511,7 @@ int table_set_align_percent(Table *t, TableCell *cell, unsigned percent) {
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 int table_set_ellipsize_percent(Table *t, TableCell *cell, unsigned percent) {
         int r;
 
@@ -539,6 +544,7 @@ int table_set_color(Table *t, TableCell *cell, const char *color) {
         table_get_data(t, cell)->color = empty_to_null(color);
         return 0;
 }
+#endif // 0
 
 int table_add_many_internal(Table *t, TableDataType first_type, ...) {
         TableDataType type;
@@ -1238,6 +1244,7 @@ size_t table_get_rows(Table *t) {
         return t->n_cells / t->n_columns;
 }
 
+#if 0 /// UNNEEDED by elogind
 size_t table_get_columns(Table *t) {
         if (!t)
                 return 0;
@@ -1245,3 +1252,4 @@ size_t table_get_columns(Table *t) {
         assert(t->n_columns > 0);
         return t->n_columns;
 }
+#endif // 0
index c9185c5672ddfc6823942c7d4541eb1c2eab1b16..b8f068e9996ed13efd7b244998f4172560130bc7 100644 (file)
@@ -1,11 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
-//#include <stdbool.h>
-//#include <stdio.h>
-//#include <sys/types.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <sys/types.h>
 
-//#include "macro.h"
+#include "macro.h"
 
 typedef enum TableDataType {
         TABLE_EMPTY,
@@ -34,14 +34,18 @@ static inline int table_add_cell(Table *t, TableCell **ret_cell, TableDataType t
         return table_add_cell_full(t, ret_cell, type, data, (size_t) -1, (size_t) -1, (unsigned) -1, (unsigned) -1, (unsigned) -1);
 }
 
+#if 0 /// UNNEEDED by elogind
 int table_dup_cell(Table *t, TableCell *cell);
 
 int table_set_minimum_width(Table *t, TableCell *cell, size_t minimum_width);
 int table_set_maximum_width(Table *t, TableCell *cell, size_t maximum_width);
 int table_set_weight(Table *t, TableCell *cell, unsigned weight);
+#endif // 0
 int table_set_align_percent(Table *t, TableCell *cell, unsigned percent);
+#if 0 /// UNNEEDED by elogind
 int table_set_ellipsize_percent(Table *t, TableCell *cell, unsigned percent);
 int table_set_color(Table *t, TableCell *cell, const char *color);
+#endif // 0
 
 int table_add_many_internal(Table *t, TableDataType first_type, ...);
 #define table_add_many(t, ...) table_add_many_internal(t, __VA_ARGS__, _TABLE_DATA_TYPE_MAX)
@@ -59,4 +63,6 @@ static inline TableCell* TABLE_HEADER_CELL(size_t i) {
 }
 
 size_t table_get_rows(Table *t);
+#if 0 /// UNNEEDED by elogind
 size_t table_get_columns(Table *t);
+#endif // 0
index 27d6ace453a984840fe31446160eb2a3a7d4e380..c199e78c8aae49fca95f492ea4233e00eed0bbb5 100644 (file)
@@ -260,6 +260,8 @@ basic_sources = files('''
         fileio.h
         fileio-label.c
         fileio-label.h
+        format-table.c
+        format-table.h
         format-util.h
         fs-util.c
         fs-util.h
index 6c5ae9f87d02d13b0046466cfdbdc8ce7478a2d0..adcc41416150a5af9ca9035133b13fc1095214d2 100644 (file)
@@ -1,9 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-//#include "alloc-util.h"
-//#include "format-table.h"
-//#include "string-util.h"
-//#include "time-util.h"
+#include "alloc-util.h"
+#include "format-table.h"
+#include "string-util.h"
+#include "time-util.h"
 
 int main(int argc, char *argv[]) {