From 2b5d1ae678011075ca0413d36395313f7f001f26 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 31 May 2017 23:00:39 +0200 Subject: [PATCH] show: Also print the possible decoder input/output IDs. --- show.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/show.c b/show.c index f09095a..62a1ac4 100644 --- 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) { -- 2.30.2