]> sigrok.org Git - libsigrok.git/blobdiff - session_file.c
Rename 'struct sr_probe' to 'struct sr_channel' everywhere.
[libsigrok.git] / session_file.c
index 545abcfdbd4fcc198bf933aeb2bf113baee54471..84163a30e65dfd38b1610a08b708c434dbc11725 100644 (file)
@@ -81,10 +81,11 @@ SR_PRIV int sr_sessionfile_check(const char *filename)
        zip_fclose(zf);
        s[ret] = 0;
        version = strtoull(s, NULL, 10);
-       if (version != 1) {
+       if (version > 2) {
                sr_dbg("Cannot handle sigrok session file version %d.", version);
                return SR_ERR;
        }
+       sr_spew("Detected sigrok session file version %d.", version);
 
        /* read "metadata" */
        if (zip_stat(archive, "metadata", 0, &zs) == -1) {
@@ -112,7 +113,7 @@ SR_API int sr_session_load(const char *filename)
        struct zip_file *zf;
        struct zip_stat zs;
        struct sr_dev_inst *sdi;
-       struct sr_probe *probe;
+       struct sr_channel *probe;
        int ret, probenum, devcnt, i, j;
        uint64_t tmp_u64, total_probes, enabled_probes, p;
        char **sections, **keys, *metafile, *val;
@@ -233,7 +234,7 @@ SR_API int sr_session_load(const char *filename)
 SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi,
                unsigned char *buf, int unitsize, int units)
 {
-       struct sr_probe *probe;
+       struct sr_channel *probe;
        GSList *l;
        GVariant *gvar;
        uint64_t samplerate;
@@ -304,7 +305,7 @@ SR_API int sr_session_save_init(const char *filename, uint64_t samplerate,
                return SR_ERR;
 
        /* "version" */
-       version[0] = '1';
+       version[0] = '2';
        if (!(versrc = zip_source_buffer(zipfile, version, 1, 0)))
                return SR_ERR;
        if (zip_add(zipfile, "version", versrc) == -1) {