From d5ab64babf535e77405c5082fa2a5ff524f5a22c Mon Sep 17 00:00:00 2001 From: Robert Kessl Date: Fri, 18 Jul 2014 13:57:30 +0200 Subject: [PATCH] tableprinter: return value of table_set_col_opt changed to int --- ucw/table.c | 2 +- ucw/table.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ucw/table.c b/ucw/table.c index 7482b1c0..e81dcdd8 100644 --- a/ucw/table.c +++ b/ucw/table.c @@ -218,7 +218,7 @@ static char * table_parse_col_arg(char *col_def) /** * Setting options for basic table types (as defined in table.h) **/ -bool table_set_col_opt_default(struct table *tbl, int col_idx, const char *col_arg, char **err) +int table_set_col_opt_default(struct table *tbl, int col_idx, const char *col_arg, char **err) { const struct table_column *col_def = tbl->column_order[col_idx].col_def; diff --git a/ucw/table.h b/ucw/table.h index 7fc6dc67..2a1e76ca 100644 --- a/ucw/table.h +++ b/ucw/table.h @@ -91,6 +91,12 @@ struct table; +enum table_option_state { + TABLE_OPT_PROCESSED, + TABLE_OPT_UNKNOWN, + TABLE_OPT_ERR +}; + /** * Definition of a single table column. * Usually, this is generated using the `TABLE_COL_`'type' macros. @@ -102,7 +108,7 @@ struct table_column { uint fmt; // [*] default format of the column const struct xtype *type_def; // [*] pointer to xtype of this column - bool (*set_col_instance_option)(struct table *tbl, uint col, const char *value, char **err); + int (*set_col_instance_option)(struct table *tbl, uint col, const char *value, char **err); // [*] process table option for a column instance }; @@ -340,7 +346,7 @@ int table_get_col_idx(struct table *tbl, const char *col_name); /** * Sets a string argument to a column instance **/ -bool table_set_col_opt_default(struct table *tbl, int col_idx, const char *col_arg, char ** err); +int table_set_col_opt_default(struct table *tbl, int col_idx, const char *col_arg, char ** err); /** * Returns a comma-and-space-separated list of column names, allocated from table's internal -- 2.39.2