X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fsession_file.c;h=2515ca5e7ebc9ab1e5225a7f4c4ec88a94aa9dc5;hb=755793e991c4d429f99254f23008bfddb89d8e00;hp=9b3712066678734d71eedee918d329408f71d752;hpb=9cfc695ffe5f04622f61acb98ea4ac91c3f4ffc3;p=libsigrok.git diff --git a/src/session_file.c b/src/session_file.c index 9b371206..2515ca5e 100644 --- a/src/session_file.c +++ b/src/session_file.c @@ -47,8 +47,8 @@ extern SR_PRIV struct sr_dev_driver session_driver; static int session_driver_initialized = 0; #if !HAVE_ZIP_DISCARD -/* Replacement for zip_discard() if it isn't available. - */ +/* Replacement for zip_discard() if it isn't available. */ +/** @private */ SR_PRIV void sr_zip_discard(struct zip *archive) { if (zip_unchange_all(archive) < 0 || zip_close(archive) < 0) @@ -56,10 +56,15 @@ SR_PRIV void sr_zip_discard(struct zip *archive) } #endif -/** Read metadata entries from a session archive. +/** + * Read metadata entries from a session archive. + * * @param[in] archive An open ZIP archive. * @param[in] entry Stat buffer filled in for the metadata archive member. + * * @return A new key/value store containing the session metadata. + * + * @private */ SR_PRIV GKeyFile *sr_sessionfile_read_metadata(struct zip *archive, const struct zip_stat *entry) @@ -162,14 +167,15 @@ SR_PRIV int sr_sessionfile_check(const char *filename) return SR_OK; } - + +/** @private */ SR_PRIV struct sr_dev_inst *sr_session_prepare_sdi(const char *filename, struct sr_session **session) { struct sr_dev_inst *sdi = NULL; sdi = g_malloc0(sizeof(struct sr_dev_inst)); sdi->driver = &session_driver; - sdi->status = SR_ST_ACTIVE; + sdi->status = SR_ST_INACTIVE; if (!session_driver_initialized) { /* first device, init the driver */ session_driver_initialized = 1; @@ -234,6 +240,8 @@ SR_API int sr_session_load(struct sr_context *ctx, const char *filename, return ret; } + total_channels = 0; + error = NULL; ret = SR_OK; file_has_logic = FALSE;