_context(context),
_saving(false)
{
- check(sr_session_new(&_structure));
+ check(sr_session_new(context->structure, &_structure));
_context->_session = this;
}
SR_API struct sr_trigger *sr_session_trigger_get(struct sr_session *session);
/* Session setup */
-SR_API int sr_session_load(const char *filename, struct sr_session **session);
-SR_API int sr_session_new(struct sr_session **session);
+SR_API int sr_session_load(struct sr_context *ctx, const char *filename,
+ struct sr_session **session);
+SR_API int sr_session_new(struct sr_context *ctx, struct sr_session **session);
SR_API int sr_session_destroy(struct sr_session *session);
SR_API int sr_session_dev_remove_all(struct sr_session *session);
SR_API int sr_session_dev_add(struct sr_session *session,
/**
* Create a new session.
*
+ * @param ctx The context in which to create the new session.
* @param new_session This will contain a pointer to the newly created
* session if the return value is SR_OK, otherwise the value
* is undefined and should not be used. Must not be NULL.
*
* @since 0.4.0
*/
-SR_API int sr_session_new(struct sr_session **new_session)
+SR_API int sr_session_new(struct sr_context *ctx,
+ struct sr_session **new_session)
{
struct sr_session *session;
/**
* 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.
*
* @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;
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;