]> mj.ucw.cz Git - libucw.git/commitdiff
xtypes&tableprinter: basic cleanup
authorRobert Kessl <kesslr@centrum.cz>
Mon, 14 Jul 2014 08:36:54 +0000 (10:36 +0200)
committerRobert Kessl <kesslr@centrum.cz>
Mon, 14 Jul 2014 08:36:54 +0000 (10:36 +0200)
ucw/table-types.c
ucw/table.h
ucw/xtypes-basic.c

index fc8f6ed811a00e671fc3fb2aee344e238e795953..750aa9423704d9944c0598ee876486b2162e8592 100644 (file)
@@ -106,7 +106,7 @@ void table_col_size(struct table *tbl, int col, u64 val)
       out_type = SIZE_UNIT_BYTE;
     } else if(curr_col->output_type == XTYPE_FMT_PRETTY) {
       curr_val = curr_val / unit_div[SIZE_UNIT_BYTE];
-      out_type = SIZE_UNIT_BYTE; // curr_col->output_type;
+      out_type = SIZE_UNIT_BYTE;
     } else if((curr_col->output_type & SIZE_UNITS_FIXED) != 0) {
       curr_val = curr_val / unit_div[curr_col->output_type & ~SIZE_UNITS_FIXED];
       out_type = curr_col->output_type & ~SIZE_UNITS_FIXED;
index 885d64cd437afbe3e832bb311d2bf2c466ca10ce..89684c75c75c89dce5e4f40c8fe1470341bb468a 100644 (file)
 #define COL_TYPE_DOUBLE   &xt_double
 #define COL_TYPE_ANY      NULL
 
-/*
-enum column_type {
-  COL_TYPE_STR,                // String
-  COL_TYPE_INT,                // int
-  COL_TYPE_S64,                // Signed 64-bit integer
-  COL_TYPE_INTMAX,     // intmax_t
-  COL_TYPE_UINT,       // unsigned int
-  COL_TYPE_U64,                // Unsigned 64-bit integer
-  COL_TYPE_UINTMAX,    // uintmax_t
-  COL_TYPE_BOOL,       // bool
-  COL_TYPE_DOUBLE,     // double
-  COL_TYPE_ANY,                // Any type
-  COL_TYPE_LAST
-};
-*/
-
 /** Justify cell contents to the left. **/
 #define CELL_ALIGN_LEFT     (1U << 31)
 
@@ -114,11 +98,6 @@ enum column_type {
 #define CELL_FLAG_MASK (CELL_ALIGN_LEFT)
 #define CELL_WIDTH_MASK        (~CELL_FLAG_MASK)
 
-//#define CELL_OUT_UNINITIALIZED      -1
-//#define CELL_OUT_HUMAN_READABLE     -2
-//#define CELL_OUT_MACHINE_READABLE   -3
-//#define CELL_OUT_USER_DEF_START      5
-
 struct table;
 
 /**
@@ -129,8 +108,6 @@ struct table;
 struct table_column {
   const char *name;            // [*] Name of the column displayed in table header
   int width;                   // [*] Width of the column (in characters) OR'ed with column flags
-  //const char *fmt;           // [*] Default format of each cell in the column
-  //enum column_type type;     // [*] Type of the cells in the column
   enum xtype_fmt fmt;
   int first_column;             // head of linked list of columns of this type
   const struct xtype *type_def;
@@ -307,9 +284,6 @@ TABLE_COL_PROTO(s64, s64);
 TABLE_COL_PROTO(u64, u64);
 TABLE_COL_PROTO(bool, bool);
 
-//void table_col_bool(struct table *tbl, int col, bool val);
-//void table_col_bool_name(struct table *tbl, const char *col_name, bool val);
-//void table_col_bool_fmt(struct table *tbl, int col, enum xtype_fmt fmt, bool val);
 #undef TABLE_COL_PROTO
 
 /**
index 5ddb359d3ff619d8443d8cd8d9090412ab3d32d9..87fa2104f1b4357ec5b31dc08c4db16907ce6794 100644 (file)
@@ -31,7 +31,6 @@
   .format = xt_##_typename##_format,\
 };
 
-
 #define XTYPE_NUM_DEF(_type, _fmt, _typename) XTYPE_NUM_FORMAT(_type, _fmt, _typename) \
   XTYPE_NUM_PARSE(_typename)\
   XTYPE_NUM_STRUCT(_type, _typename)