]> sigrok.org Git - libsigrok.git/blobdiff - src/output/srzip.c
arachnid-labs-re-load-pro: Add support for setting SR_CONF_ENABLED.
[libsigrok.git] / src / output / srzip.c
index c562e60401654fe2bd18bd66e678c1e20e529839..787a2bab6f4a0be4c56051d8caa74e8fa97357e0 100644 (file)
@@ -82,7 +82,7 @@ static int zip_create(const struct sr_output *o)
 
        /* "version" */
        versrc = zip_source_buffer(zipfile, "2", 1, FALSE);
-       if (zip_file_add(zipfile, "version", versrc, 0) < 0) {
+       if (zip_add(zipfile, "version", versrc) < 0) {
                sr_err("Error saving version into zipfile: %s",
                        zip_strerror(zipfile));
                zip_source_free(versrc);
@@ -118,7 +118,7 @@ static int zip_create(const struct sr_output *o)
        g_key_file_free(meta);
 
        metasrc = zip_source_buffer(zipfile, metabuf, metalen, FALSE);
-       if (zip_file_add(zipfile, "metadata", metasrc, 0) < 0) {
+       if (zip_add(zipfile, "metadata", metasrc) < 0) {
                sr_err("Error saving metadata into zipfile: %s",
                        zip_strerror(zipfile));
                zip_source_free(metasrc);
@@ -296,18 +296,6 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
        return SR_OK;
 }
 
-static int cleanup(struct sr_output *o)
-{
-       struct out_context *outc;
-
-       outc = o->priv;
-       g_free(outc->filename);
-       g_free(outc);
-       o->priv = NULL;
-
-       return SR_OK;
-}
-
 static struct sr_option options[] = {
        ALL_ZERO
 };
@@ -320,6 +308,19 @@ static const struct sr_option *get_options(void)
        return options;
 }
 
+static int cleanup(struct sr_output *o)
+{
+       struct out_context *outc;
+
+       outc = o->priv;
+       g_variant_unref(options[0].def);
+       g_free(outc->filename);
+       g_free(outc);
+       o->priv = NULL;
+
+       return SR_OK;
+}
+
 SR_PRIV struct sr_output_module output_srzip = {
        .id = "srzip",
        .name = "srzip",