-int pd_add(struct srd_decoder_instance *di, int output_type,
- char *proto_id)
-{
- struct srd_pd_output *pdo;
-
- if (!(pdo = g_try_malloc(sizeof(struct srd_pd_output))))
- return -1;
-
- /* pdo_id is just a simple index, nothing is deleted from this list anyway. */
- pdo->pdo_id = g_slist_length(di->pd_output);
- pdo->output_type = output_type;
- pdo->decoder = di->decoder;
- pdo->proto_id = g_strdup(proto_id);
- di->pd_output = g_slist_append(di->pd_output, pdo);
-
- return pdo->pdo_id;
-}
-
-struct srd_decoder_instance *get_di_by_decobject(void *decobject)
-{
- GSList *l, *s;
- struct srd_decoder_instance *di;
-
- for (l = di_list; l; l = l->next) {
- di = l->data;
- if (decobject == di->py_instance)
- return di;
- /* Check decoders stacked on top of this one. */
- for (s = di->next_di; s; s = s->next) {
- di = s->data;
- if (decobject == di->py_instance)
- return di;
- }
- }
-
- return NULL;
-}
-