]> sigrok.org Git - libsigrok.git/blobdiff - src/input/vcd.c
input: Added preferred file extension field
[libsigrok.git] / src / input / vcd.c
index 96bd6335b0b3f67083ee668b0f828031d69fd803..e14215712b75c56477342a4706de8cecee5e0cf1 100644 (file)
@@ -429,7 +429,7 @@ static int init(struct sr_input *in, GHashTable *options)
        inc->skip = g_variant_get_int32(g_hash_table_lookup(options, "skip"));
        inc->skip /= inc->downsample;
 
-       in->sdi = sr_dev_inst_new(SR_ST_ACTIVE, NULL, NULL, NULL);
+       in->sdi = g_malloc0(sizeof(struct sr_dev_inst));
        in->priv = inc;
 
        for (i = 0; i < num_channels; i++) {
@@ -537,14 +537,12 @@ static int end(struct sr_input *in)
        return ret;
 }
 
-static int cleanup(struct sr_input *in)
+static void cleanup(struct sr_input *in)
 {
        struct context *inc;
 
        inc = in->priv;
        g_slist_free_full(inc->channels, free_channel);
-
-       return SR_OK;
 }
 
 static struct sr_option options[] = {
@@ -571,6 +569,7 @@ SR_PRIV struct sr_input_module input_vcd = {
        .id = "vcd",
        .name = "VCD",
        .desc = "Value Change Dump",
+       .exts = (const char*[]){"vcd", NULL},
        .metadata = { SR_INPUT_META_HEADER | SR_INPUT_META_REQUIRED },
        .options = get_options,
        .format_match = format_match,