X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Foutput%2Fsrzip.c;h=690736c8f15c1425ed897a2976157a0a1798dcf8;hb=37875f750614;hp=18a79d5b50b15403319af4c916340c819113ee84;hpb=3250d8c7e05f2d6a3ffbdf2499af8a13fa99fe39;p=libsigrok.git diff --git a/src/output/srzip.c b/src/output/srzip.c index 18a79d5b..690736c8 100644 --- a/src/output/srzip.c +++ b/src/output/srzip.c @@ -39,11 +39,16 @@ static int init(struct sr_output *o, GHashTable *options) { struct out_context *outc; + (void)options; + outc = g_malloc0(sizeof(struct out_context)); o->priv = outc; - outc->filename = g_strdup(g_variant_get_string(g_hash_table_lookup(options, "filename"), NULL)); - if (strlen(outc->filename) == 0) + + if (strlen(o->filename) == 0) { + sr_info("srzip output module requires a file name, cannot save."); return SR_ERR_ARG; + } + outc->filename = g_strdup(o->filename); return SR_OK; } @@ -296,7 +301,6 @@ static int cleanup(struct sr_output *o) } static struct sr_option options[] = { - { "filename", "Filename", "File to write", NULL, NULL }, ALL_ZERO }; @@ -312,9 +316,9 @@ SR_PRIV struct sr_output_module output_srzip = { .id = "srzip", .name = "srzip", .desc = "srzip session file", + .exts = (const char*[]){"sr", NULL}, .options = get_options, .init = init, .receive = receive, .cleanup = cleanup, }; -