X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Finput%2Fcsv.c;h=ed2b49409b43d9b25c611ce47090c435d90cb5a2;hb=c01378c95f34e60d3b67f84dc3a6c3c6c154186d;hp=0a2d7276d996eb14b5f0310999feb1ed2e3c8c06;hpb=6433156c3275df933e4bf6dcfb020c91fca0ae86;p=libsigrok.git diff --git a/src/input/csv.c b/src/input/csv.c index 0a2d7276..ed2b4940 100644 --- a/src/input/csv.c +++ b/src/input/csv.c @@ -17,6 +17,7 @@ * along with this program. If not, see . */ +#include #include #include #include @@ -132,17 +133,6 @@ struct context { size_t line_number; }; -static int format_match(GHashTable *metadata) -{ - char *buf; - - buf = g_hash_table_lookup(metadata, GINT_TO_POINTER(SR_INPUT_META_MIMETYPE)); - if (!strcmp(buf, "text/csv")) - return SR_OK; - - return SR_ERR; -} - static void strip_comment(char *buf, const GString *prefix) { char *ptr; @@ -631,6 +621,7 @@ static int process_buffer(struct sr_input *in) src = sr_config_new(SR_CONF_SAMPLERATE, g_variant_new_uint64(samplerate)); meta.config = g_slist_append(NULL, src); sr_session_send(in->sdi, &packet); + g_slist_free(meta.config); sr_config_free(src); } @@ -794,7 +785,7 @@ static struct sr_option options[] = { ALL_ZERO }; -static struct sr_option *get_options(void) +static const struct sr_option *get_options(void) { if (!options[0].def) { options[0].def = g_variant_ref_sink(g_variant_new_int32(0)); @@ -816,9 +807,7 @@ SR_PRIV struct sr_input_module input_csv = { .name = "CSV", .desc = "Comma-separated values", .exts = (const char*[]){"csv", NULL}, - .metadata = { SR_INPUT_META_MIMETYPE }, .options = get_options, - .format_match = format_match, .init = init, .receive = receive, .end = end,