Skip to content

Commit

Permalink
Show PD annotation row members by name, not number.
Browse files Browse the repository at this point in the history
This fixes bug 388.
  • Loading branch information
biot committed Aug 1, 2014
1 parent d26a362 commit 3d7bf97
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions show.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,13 @@ void show_dev_detail(void)
#ifdef HAVE_SRD
void show_pd_detail(void)
{
GSList *l, *ll, *ol;
struct srd_decoder *dec;
struct srd_decoder_option *o;
char **pdtokens, **pdtok, *optsep, **ann, *val, *doc;
struct srd_channel *pdch;
struct srd_decoder_annotation_row *r;
GSList *l, *ll, *ol;
int idx;
char **pdtokens, **pdtok, *optsep, **ann, *val, *doc;

pdtokens = g_strsplit(opt_pds, ",", -1);
for (pdtok = pdtokens; *pdtok; pdtok++) {
Expand Down Expand Up @@ -583,8 +584,13 @@ void show_pd_detail(void)
for (l = dec->annotation_rows; l; l = l->next) {
r = l->data;
printf("- %s (%s): ", r->id, r->desc);
for (ll = r->ann_classes; ll; ll = ll->next)
printf("%d ", GPOINTER_TO_INT(ll->data));
for (ll = r->ann_classes; ll; ll = ll->next) {
idx = GPOINTER_TO_INT(ll->data);
ann = g_slist_nth_data(dec->annotations, idx);
printf("%s", ann[0]);
if (ll->next)
printf(", ");
}
printf("\n");
}
} else {
Expand Down

0 comments on commit 3d7bf97

Please sign in to comment.