]> sigrok.org Git - sigrok-cli.git/blobdiff - show.c
valgrind: Clear more unfreed memory issues
[sigrok-cli.git] / show.c
diff --git a/show.c b/show.c
index 39db85f58cff515abd86b1bc1b40b047c1ba0cd9..eca05b8b92216145dc998213b32e8b6b75efc1ee 100644 (file)
--- a/show.c
+++ b/show.c
@@ -241,7 +241,7 @@ void show_drv_detail(struct sr_dev_driver *driver)
                g_array_free(opts, TRUE);
        }
 
-       if ((opts = sr_driver_scan_options(driver))) {
+       if ((opts = sr_driver_scan_options_list(driver))) {
                if (opts->len > 0) {
                        printf("Scan options:\n");
                        for (i = 0; i < opts->len; i++) {
@@ -386,7 +386,7 @@ void show_dev_detail(void)
                        g_variant_unref(gvar_list);
 
                } else if (key == SR_CONF_LIMIT_SAMPLES
-                               && (sr_dev_config_capabilities(sdi, NULL, key)
+                               && (sr_dev_config_capabilities_list(sdi, NULL, key)
                                        & SR_CONF_LIST)) {
                        /*
                         * If implemented in config_list(), this denotes the
@@ -674,7 +674,7 @@ void show_dev_detail(void)
 }
 
 #ifdef HAVE_SRD
-void show_pd_detail(void)
+static void show_pd_detail_single(const char *pd)
 {
        struct srd_decoder *dec;
        struct srd_decoder_option *o;
@@ -682,9 +682,9 @@ void show_pd_detail(void)
        struct srd_decoder_annotation_row *r;
        GSList *l, *ll, *ol;
        int idx;
-       char **pdtokens, **pdtok, *optsep, **ann, *val, *doc;
+       char **pdtokens, **pdtok, *optsep, **ann, **bin, *val, *doc;
 
-       pdtokens = g_strsplit(opt_pds, ",", -1);
+       pdtokens = g_strsplit(pd, ",", -1);
        for (pdtok = pdtokens; *pdtok; pdtok++) {
                /* Strip options. */
                if ((optsep = strchr(*pdtok, ':')))
@@ -722,6 +722,15 @@ void show_pd_detail(void)
                } else {
                        printf("None.\n");
                }
+               printf("Binary classes:\n");
+               if (dec->binary) {
+                       for (l = dec->binary; l; l = l->next) {
+                               bin = l->data;
+                               printf("- %s: %s\n", bin[0], bin[1]);
+                       }
+               } else {
+                       printf("None.\n");
+               }
                printf("Required channels:\n");
                if (dec->channels) {
                        for (l = dec->channels; l; l = l->next) {
@@ -768,6 +777,12 @@ void show_pd_detail(void)
 
        g_strfreev(pdtokens);
 }
+
+void show_pd_detail(void)
+{
+       for (int i = 0; opt_pds[i]; i++)
+               show_pd_detail_single(opt_pds[i]);
+}
 #endif
 
 void show_input(void)