]> sigrok.org Git - libsigrok.git/blobdiff - session_file.c
Add sr_ prefix for 'struct session'.
[libsigrok.git] / session_file.c
index 88dfe4f5bb96a1bc28aeaec587b63d5aef31a8bf..bd3548ab4f7799a78a9c7b0ccee1e98704c3ef02 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "config.h"
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <zip.h>
 #include <glib.h>
+#include <glib/gstdio.h>
 #include <sigrok.h>
-#include <config.h>
 
-
-extern struct session *session;
+extern struct sr_session *session;
 extern struct sr_device_plugin session_driver;
 
 
@@ -37,9 +37,9 @@ int session_load(const char *filename)
        struct zip *archive;
        struct zip_file *zf;
        struct zip_stat zs;
-       struct session *session;
+       struct sr_session *session;
        struct sr_device *device;
-       struct probe *probe;
+       struct sr_probe *probe;
        int ret, err, probenum, devcnt, i, j;
        uint64_t tmp_u64, total_probes, enabled_probes, p;
        char **sections, **keys, *metafile, *val, c;
@@ -141,7 +141,7 @@ int session_save(char *filename)
        GSList *l, *p, *d;
        FILE *meta;
        struct sr_device *device;
-       struct probe *probe;
+       struct sr_probe *probe;
        struct datastore *ds;
        struct zip *zipfile;
        struct zip_source *versrc, *metasrc, *logicsrc;
@@ -169,7 +169,7 @@ int session_save(char *filename)
        if ((tmpfile = g_mkstemp(metafile)) == -1)
                return SR_ERR;
        close(tmpfile);
-       meta = fopen(metafile, "wb");
+       meta = g_fopen(metafile, "wb");
        fprintf(meta, "[global]\n");
        fprintf(meta, "sigrok version = %s\n", PACKAGE_VERSION);
        /* TODO: save protocol decoders used */