]> 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 54b367c909a98046d11d25b8dc34cb53e6bf73ed..eca05b8b92216145dc998213b32e8b6b75efc1ee 100644 (file)
--- a/show.c
+++ b/show.c
@@ -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)