]> sigrok.org Git - sigrok-cli.git/commitdiff
sigrok-cli: Update for sr_session_{new,load} API change.
authorMartin Ling <redacted>
Wed, 25 Mar 2015 01:54:52 +0000 (01:54 +0000)
committerMartin Ling <redacted>
Wed, 25 Mar 2015 21:50:16 +0000 (21:50 +0000)
input.c
session.c
sigrok-cli.h

diff --git a/input.c b/input.c
index 9d7bf626cd24a2341afaa1d29f83b381deadb4f4..a0b054af337aa2c83d284b17ab707f6c59a0e2f2 100644 (file)
--- a/input.c
+++ b/input.c
@@ -107,7 +107,7 @@ static void load_input_file_module(void)
                if (!in)
                        g_critical("Error: no input module found for this file.");
        }
-       sr_session_new(&session);
+       sr_session_new(sr_ctx, &session);
        sr_session_datafeed_callback_add(session, &datafeed_in, NULL);
 
        got_sdi = FALSE;
@@ -155,7 +155,8 @@ void load_input_file(void)
                /* Input from stdin is never a session file. */
                load_input_file_module();
        } else {
-               if ((ret = sr_session_load(opt_input_file, &session)) == SR_OK) {
+               if ((ret = sr_session_load(sr_ctx, opt_input_file,
+                               &session)) == SR_OK) {
                        /* sigrok session file */
                        ret = sr_session_dev_list(session, &devices);
                        if (ret != SR_OK || !devices || !devices->data) {
index aa30266f975e9447a72a8dafa4f7b21fcf05f42a..983d4841af7e3a2cce5960d85ac7dad72b3406ec 100644 (file)
--- a/session.c
+++ b/session.c
@@ -553,7 +553,7 @@ void run_session(void)
        g_slist_free(devices);
        g_slist_free(real_devices);
 
-       sr_session_new(&session);
+       sr_session_new(sr_ctx, &session);
        sr_session_datafeed_callback_add(session, datafeed_in, NULL);
 
        if (sr_dev_open(sdi) != SR_OK) {
index d7b9d9cee954f7fcff9f5c44ca43e9594a3a7f54..ac866696eeed35660469060c777c4269cb4555c4 100644 (file)
@@ -31,6 +31,7 @@
 #define SAVE_CHUNK_SIZE (512 * 1024)
 
 /* main.c */
+struct sr_context *sr_ctx;
 int select_channels(struct sr_dev_inst *sdi);
 gboolean config_key_has_cap(struct sr_dev_driver *driver,
                const struct sr_dev_inst *sdi, struct sr_channel_group *cg,