struct context *inc;
const char *s;
- in->sdi = sr_dev_inst_new(SR_ST_ACTIVE, NULL, NULL, NULL);
+ in->sdi = g_malloc0(sizeof(struct sr_dev_inst));
in->priv = inc = g_malloc0(sizeof(struct context));
inc->single_column = g_variant_get_int32(g_hash_table_lookup(options, "single-column"));
continue;
}
+ /* Skip the header line, its content was used as the channel names. */
+ if (inc->header) {
+ sr_spew("Header line %zu skipped.", inc->line_number);
+ inc->header = FALSE;
+ continue;
+ }
+
if (!(columns = parse_line(lines[l], inc, max_columns))) {
sr_err("Error while parsing line %zu.", inc->line_number);
return SR_ERR;
.id = "csv",
.name = "CSV",
.desc = "Comma-separated values",
+ .exts = (const char*[]){"csv", NULL},
.metadata = { SR_INPUT_META_MIMETYPE },
.options = get_options,
.format_match = format_match,