Robert Kessl [Wed, 9 Jul 2014 14:12:23 +0000 (16:12 +0200)]
tableprinter: code cleanup contd.
- update of cell output types: CELL_OUT_UNINITIALIZED is -1, CELL_OUT_HUMAN_READABLE is now -2 and CELL_OUT_MACHINE_READABLE -3
- table_col_bool* now uses bool instead of uint
- other code cleanup
Robert Kessl [Wed, 9 Jul 2014 11:42:08 +0000 (13:42 +0200)]
tableprinter: code cleanup contd.
- renamed table_col_info -> table_col_instance
- table_init now uses const for struct table_template
- some initialization moved from table_init to table_make_instance
Robert Kessl [Wed, 9 Jul 2014 08:36:02 +0000 (10:36 +0200)]
tableprinter: code cleanup
- renamed table_set_all_cols_content -> table_set_all_inst_content
- renamed all UNIT_*, e.g., UNIT_BYTE -> UNIT_SIZE_BYTE
- instead of using the word 'copy' for a column, now we use instance
- removal of unnecessary ucw/config.h
Robert Kessl [Mon, 7 Jul 2014 13:18:05 +0000 (15:18 +0200)]
tableprinter: table_init now makes a copy of its argument
- tableprinter now considers the argument to table_init as a template
and makes a copy of it. Copy of the template (struct table) is allocated
on the table template pool.
- FIXME: documentation must be updated
Robert Kessl [Tue, 1 Jul 2014 14:58:20 +0000 (16:58 +0200)]
tableprinter: added parsing of column arg; bugfixes
- added parsing of column args. Now it is possible to specify column
using the following format: <col-name>['['<arg>']']
- fix of printing of timestamp and size: single value was set for all
instances of a column. Now each column instance has value in its
format.
Robert Kessl [Mon, 30 Jun 2014 13:21:47 +0000 (15:21 +0200)]
tableprinter: first shot on update of internals
- due to changes in the internals appends are no longer support
- each column type now supports multiple copies in the output with
potentially different output format. However, some column types
are kept separated: uint vs. hex (historical reasons).
- when the API user starts using table_col_printf or
table_col_fbstart then the different kind of formats are ignored.
Martin Mares [Fri, 27 Jun 2014 15:27:25 +0000 (17:27 +0200)]
Opt: Added OPT_BREAK
This is useful for programs, which wish to process all their
positional arguments by themselves without having to copy them
to a different data structure. For example, this frequently happens
with programs which have sub-commands.
Pavel Charvat [Mon, 2 Jun 2014 22:20:58 +0000 (00:20 +0200)]
Build: Improved paths in local builds.
* CONFIG_LOCAL by default uses absolute paths,
so you can execute run/bin/* from anywhere or
directly use resulting *.pc by external commands.
* Define CONFIG_RELATIVE_PATHS for old relative paths.
* Removed SONAME_PREFIX, replaced with -rpath.
Martin Mares [Fri, 30 May 2014 14:26:31 +0000 (16:26 +0200)]
Table: Clean up column list parsing
First of all, an empty list of columns is a little bit obscure,
but still correct and it should work properly.
table_col_order_by_name() now returns a sensible error message
for non-existent columns.
table_get_col_list() now uses ", " as a separator, which is more
readable. It is documented where the string is allocated from. Also,
it uses the growing string in mempool properly, even in cases when
it is reallocated.
Martin Mares [Fri, 30 May 2014 14:04:06 +0000 (16:04 +0200)]
Table: Fixed bugs in header printing configuration
Previously, the user-defined setting of table->print_header
was overwritten at various locations, making multiple uses of
table_start()/table_end() on a single table close to unusable.
Now, table->print_header is not modified by the table printer
itself, except for table_init().