+const char *table_set_col_opt(struct table *tbl, uint col_inst_idx, const char *col_opt)
+{
+ const struct table_column *col_def = tbl->column_order[col_inst_idx].col_def;
+
+ // Make sure that we do not call table_set_col_opt, which would
+ // result in an infinite recursion.
+ if(col_def && col_def->set_col_opt) {
+ ASSERT_MSG(col_def->set_col_opt != table_set_col_opt,"table_set_col_opt should not be used as a struct table_column::set_col_opt hook");
+ return col_def->set_col_opt(tbl, col_inst_idx, col_opt);
+ }
+
+ if(col_def && col_def->type_def) {
+ u32 fmt = 0;
+ const char *tmp_err = xtype_parse_fmt(col_def->type_def, col_opt, &fmt, tbl->pool);
+ if(tmp_err) return mp_printf(tbl->pool, "Invalid column format; xtypes error: '%s'.", tmp_err);
+ tbl->column_order[col_inst_idx].fmt = fmt;
+ return NULL;
+ }
+
+ return mp_printf(tbl->pool, "Invalid column format option: '%s' for column %d.", col_opt, col_inst_idx);
+}
+
+/**
+ * the input is a null-terminated string that contains: "<col-name>'['<param1>','<param2>\0
+ * i.e., the ']' is missing and is replaced by \0.
+ * the function replace the '[' by \0 and then parses the rest of the string.
+ **/
+static char **table_parse_col_arg2(char *col_def)