Update due to sr_driver_list() now taking a context.
authorUwe Hermann <uwe@hermann-uwe.de>
Sat, 4 Apr 2015 17:34:06 +0000 (19:34 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Tue, 7 Apr 2015 00:37:34 +0000 (02:37 +0200)
device.c
parsers.c
show.c
sigrok-cli.h

index 17505e2..2d63cab 100644 (file)
--- a/device.c
+++ b/device.c
@@ -22,8 +22,6 @@
 #include "sigrok-cli.h"
 #include "config.h"
 
-extern struct sr_context *sr_ctx;
-
 static void free_drvopts(struct sr_config *src)
 {
        g_variant_unref(src->data);
@@ -44,7 +42,7 @@ GSList *device_scan(void)
        } else {
                /* No driver specified, let them all scan on their own. */
                devices = NULL;
-               drivers = sr_driver_list();
+               drivers = sr_driver_list(sr_ctx);
                for (i = 0; drivers[i]; i++) {
                        driver = drivers[i];
                        if (sr_driver_init(sr_ctx, driver) != SR_OK) {
index f7d03bc..d788532 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -24,8 +24,6 @@
 #include <glib.h>
 #include "sigrok-cli.h"
 
-extern struct sr_context *sr_ctx;
-
 struct sr_channel *find_channel(GSList *channellist, const char *channelname)
 {
        struct sr_channel *ch;
@@ -415,7 +413,7 @@ int parse_driver(char *arg, struct sr_dev_driver **driver, GSList **drvopts)
        drvname = g_strdup(g_hash_table_lookup(drvargs, "sigrok_key"));
        g_hash_table_remove(drvargs, "sigrok_key");
        *driver = NULL;
-       drivers = sr_driver_list();
+       drivers = sr_driver_list(sr_ctx);
        for (i = 0; drivers[i]; i++) {
                if (strcmp(drivers[i]->name, drvname))
                        continue;
diff --git a/show.c b/show.c
index 88a272f..aec61f1 100644 (file)
--- a/show.c
+++ b/show.c
@@ -78,7 +78,7 @@ void show_version(void)
 #endif
 
        printf("Supported hardware drivers:\n");
-       drivers = sr_driver_list();
+       drivers = sr_driver_list(sr_ctx);
        for (sl = NULL, i = 0; drivers[i]; i++)
                sl = g_slist_append(sl, drivers[i]);
        sl = g_slist_sort(sl, sort_drivers);
index ac86669..f05a169 100644 (file)
@@ -31,7 +31,7 @@
 #define SAVE_CHUNK_SIZE (512 * 1024)
 
 /* main.c */
-struct sr_context *sr_ctx;
+extern 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,