]> sigrok.org Git - libsigrok.git/blobdiff - src/input/csv.c
input: s/format/module in all naming.
[libsigrok.git] / src / input / csv.c
index 6dd06f4877ccbc4e4f592c4bdca4e807a77a858e..c0316b62565f4bd84ac9966ca0bf9287ebd7c0a4 100644 (file)
@@ -134,6 +134,10 @@ struct context {
 
 static int format_match(const char *filename)
 {
+       /* Require .csv extension. */
+       if (strcmp(filename + strlen(filename) - 4, ".csv"))
+               return FALSE;
+
        if (!filename) {
                sr_err("%s: filename was NULL.", __func__);
                return FALSE;
@@ -859,7 +863,7 @@ static int loadfile(struct sr_input *in, const char *filename)
        return SR_OK;
 }
 
-SR_PRIV struct sr_input_format input_csv = {
+SR_PRIV struct sr_input_module input_csv = {
        .id = "csv",
        .description = "Comma-separated values (CSV)",
        .format_match = format_match,