summaryrefslogtreecommitdiff
path: root/decoder.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2017-05-31 22:51:23 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2017-05-31 23:07:01 +0200
commitd480174d51b327ad8e579d79f619607a9687597e (patch)
tree3eab97821a42ebb0a8bbb86a14fdd153f98edb44 /decoder.c
parentcdb49509e85443129f2d60180eb818813030901e (diff)
downloadlibsigrokdecode-d480174d51b327ad8e579d79f619607a9687597e.tar.gz
libsigrokdecode-d480174d51b327ad8e579d79f619607a9687597e.zip
struct srd_decoder: Add list of input/output decoder IDs.
Diffstat (limited to 'decoder.c')
-rw-r--r--decoder.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/decoder.c b/decoder.c
index 9990e29..9c57b1c 100644
--- a/decoder.c
+++ b/decoder.c
@@ -165,6 +165,8 @@ static void decoder_free(struct srd_decoder *dec)
g_slist_free_full(dec->opt_channels, &channel_free);
g_slist_free_full(dec->channels, &channel_free);
+ g_slist_free_full(dec->outputs, g_free);
+ g_slist_free_full(dec->inputs, g_free);
g_free(dec->license);
g_free(dec->desc);
g_free(dec->longname);
@@ -727,6 +729,16 @@ SRD_API int srd_decoder_load(const char *module_name)
goto err_out;
}
+ if (py_attr_as_strlist(d->py_dec, "inputs", &(d->inputs)) != SRD_OK) {
+ fail_txt = "missing or malformed 'inputs' attribute";
+ goto err_out;
+ }
+
+ if (py_attr_as_strlist(d->py_dec, "outputs", &(d->outputs)) != SRD_OK) {
+ fail_txt = "missing or malformed 'outputs' attribute";
+ goto err_out;
+ }
+
/* All options and their default values. */
if (get_options(d) != SRD_OK) {
fail_txt = "cannot get options";