X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fsession_file.c;h=5aed89b8bbf2530cccfc21c0d1d3cba1ff9ed616;hb=a1f7c854c502cca8fe7e5576b9a01ad1086f9170;hp=91d4d7775f9f2223e3f4ca58f3259d8fcfa2cbcd;hpb=1beccaed464a4d92a070988a0331fe399f9f7a7a;p=libsigrok.git diff --git a/src/session_file.c b/src/session_file.c index 91d4d777..5aed89b8 100644 --- a/src/session_file.c +++ b/src/session_file.c @@ -26,8 +26,7 @@ #include #include #include -#include "config.h" /* Needed for PACKAGE_VERSION and others. */ -#include "libsigrok.h" +#include #include "libsigrok-internal.h" /** @cond PRIVATE */ @@ -105,6 +104,7 @@ SR_PRIV int sr_sessionfile_check(const char *filename) /** * Load the session from the specified filename. * + * @param ctx The context in which to load the session. * @param filename The name of the session file to load. * @param session The session to load the file into. * @@ -113,7 +113,8 @@ SR_PRIV int sr_sessionfile_check(const char *filename) * @retval SR_ERR_DATA Malformed session file * @retval SR_ERR This is not a session file */ -SR_API int sr_session_load(const char *filename, struct sr_session **session) +SR_API int sr_session_load(struct sr_context *ctx, const char *filename, + struct sr_session **session) { GKeyFile *kf; GPtrArray *capturefiles; @@ -151,7 +152,7 @@ SR_API int sr_session_load(const char *filename, struct sr_session **session) return SR_ERR; } - if ((ret = sr_session_new(session)) != SR_OK) + if ((ret = sr_session_new(ctx, session)) != SR_OK) return ret; ret = SR_OK; @@ -349,7 +350,7 @@ SR_API int sr_session_save_init(struct sr_session *session, close(tmpfile); meta = g_fopen(metafile, "wb"); fprintf(meta, "[global]\n"); - fprintf(meta, "sigrok version = %s\n", PACKAGE_VERSION); + fprintf(meta, "sigrok version = %s\n", SR_PACKAGE_VERSION_STRING); /* metadata */ fprintf(meta, "[device 1]\n");