show: Also print the possible decoder input/output IDs.
authorUwe Hermann <uwe@hermann-uwe.de>
Wed, 31 May 2017 21:00:39 +0000 (23:00 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Wed, 31 May 2017 21:00:39 +0000 (23:00 +0200)
show.c

diff --git a/show.c b/show.c
index f09095a5c9f1802630c757e3f2ec890949dfbcc2..62a1ac44cafdc2243f8c4663944733d23ff4c303 100644 (file)
--- a/show.c
+++ b/show.c
@@ -682,7 +682,7 @@ static void show_pd_detail_single(const char *pd)
        struct srd_decoder_annotation_row *r;
        GSList *l, *ll, *ol;
        int idx;
-       char **pdtokens, **pdtok, *optsep, **ann, **bin, *val, *doc;
+       char **pdtokens, **pdtok, *optsep, **ann, **bin, *val, *doc, *str;
 
        pdtokens = g_strsplit(pd, ",", -1);
        for (pdtok = pdtokens; *pdtok; pdtok++) {
@@ -696,6 +696,24 @@ static void show_pd_detail_single(const char *pd)
                printf("ID: %s\nName: %s\nLong name: %s\nDescription: %s\n",
                                dec->id, dec->name, dec->longname, dec->desc);
                printf("License: %s\n", dec->license);
+               printf("Possible decoder input IDs:\n");
+               if (dec->inputs) {
+                       for (l = dec->inputs; l; l = l->next) {
+                               str = l->data;
+                               printf("- %s\n", str);
+                       }
+               } else {
+                       printf("None.\n");
+               }
+               printf("Possible decoder output IDs:\n");
+               if (dec->outputs) {
+                       for (l = dec->outputs; l; l = l->next) {
+                               str = l->data;
+                               printf("- %s\n", str);
+                       }
+               } else {
+                       printf("None.\n");
+               }
                printf("Annotation classes:\n");
                if (dec->annotations) {
                        for (l = dec->annotations; l; l = l->next) {