X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fsession_file.c;h=9a1e316e8fd0411158215d011d9ed91b8d7fc00d;hb=HEAD;hp=9b3712066678734d71eedee918d329408f71d752;hpb=9cfc695ffe5f04622f61acb98ea4ac91c3f4ffc3;p=libsigrok.git diff --git a/src/session_file.c b/src/session_file.c index 9b371206..dc4012d9 100644 --- a/src/session_file.c +++ b/src/session_file.c @@ -43,12 +43,14 @@ * @{ */ +/** @cond PRIVATE */ extern SR_PRIV struct sr_dev_driver session_driver; +/** @endcond */ 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 +58,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) @@ -163,13 +170,14 @@ 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 +242,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;