+ /*
+ * Derive the set of columns to inspect and their respective
+ * formats from simple input specs. Remain close to the previous
+ * set of option keywords and their meaning. Exclusively support
+ * a single column with multiple bits in it, or an adjacent set
+ * of colums with one bit each. The latter may not know the total
+ * column count here (when the user omitted the spec), and will
+ * derive it from the first text line of the input file.
+ */
+ s = g_variant_get_string(g_hash_table_lookup(options, "column-formats"), NULL);
+ if (s && *s) {
+ ret = make_column_details_from_format(inc, s);
+ if (ret != SR_OK)
+ return ret;
+ } else if (single_column && inc->logic_channels) {
+ sr_dbg("DIAG Got single column (%zu) and channels (%zu).",
+ single_column, inc->logic_channels);
+ sr_dbg("DIAG -> column %zu, %zu bits in %s format.",
+ single_column, inc->logic_channels,
+ col_format_text[format]);
+ ret = make_column_details_single(inc,
+ single_column, inc->logic_channels, format);
+ if (ret != SR_OK)
+ return ret;
+ } else if (inc->multi_column_mode) {
+ sr_dbg("DIAG Got multi-column, first column %zu, count %zu.",
+ inc->first_column, inc->logic_channels);
+ if (inc->logic_channels) {
+ sr_dbg("DIAG -> columns %zu-%zu, 1 bit each.",
+ inc->first_column,
+ inc->first_column + inc->logic_channels - 1);
+ ret = make_column_details_multi(inc, inc->first_column,
+ inc->first_column + inc->logic_channels - 1);
+ if (ret != SR_OK)
+ return ret;
+ } else {
+ sr_dbg("DIAG -> incomplete spec, have to update later.");
+ }
+ } else {
+ sr_err("Unknown or unsupported combination of option values.");