* Search a decoder instance and its stack for instance ID. * * @param[in] inst_id ID to search for. * @param[in] stack A decoder instance, potentially with stacked instances. * * @return The matching instance, or NULL. */
| 588 | * @return The matching instance, or NULL. |
| 589 | */ |
| 590 | static struct srd_decoder_inst *srd_inst_find_by_id_stack(const char *inst_id, |
| 591 | struct srd_decoder_inst *stack) |
| 592 | { |
| 593 | const GSList *l; |
| 594 | struct srd_decoder_inst *tmp, *di; |
| 595 | |
| 596 | if (!strcmp(stack->inst_id, inst_id)) |
| 597 | return stack; |
| 598 | |
| 599 | /* Otherwise, look recursively in our stack. */ |
| 600 | di = NULL; |
| 601 | if (stack->next_di) { |
| 602 | for (l = stack->next_di; l; l = l->next) { |
| 603 | tmp = l->data; |
| 604 | if (!strcmp(tmp->inst_id, inst_id)) { |
| 605 | di = tmp; |
| 606 | break; |
| 607 | } |
| 608 | } |
| 609 | } |
| 610 | |
| 611 | return di; |
| 612 | } |
| 613 | |
| 614 | /** |
| 615 | * Find a decoder instance by its instance ID. |
no outgoing calls
no test coverage detected