]> sigrok.org Git - sigrok-cli.git/commitdiff
Update due to sr_driver_list() now taking a context.
authorUwe Hermann <redacted>
Sat, 4 Apr 2015 17:34:06 +0000 (19:34 +0200)
committerUwe Hermann <redacted>
Tue, 7 Apr 2015 00:37:34 +0000 (02:37 +0200)
device.c
parsers.c
show.c
sigrok-cli.h

index 17505e26a59e60a44b7b7e50f3db8f3630499759..2d63cab419c626234b437d81e43ede64f2188f5c 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 f7d03bc6bbf230d9af2247b11ecf1fd43755e27d..d788532f17097915511383851066141a999b7007 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 88a272f3855c7636496c90f616ccc6d3efe1d7aa..aec61f142d7aff4a90a38e32a4b80ad56fb45f2d 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 ac866696eeed35660469060c777c4269cb4555c4..f05a1695caad6ef38bd4221250b39a90e56e678e 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,