]> sigrok.org Git - libsigrokdecode.git/blobdiff - controller.c
srd: clean up module loading/unloading, and the decoder struct
[libsigrokdecode.git] / controller.c
index dbc4eb0fa5dcef5c8298c657e5694f8bfd463799..963345c637c1b09ce550ecf623f1778ed48faf3c 100644 (file)
@@ -129,12 +129,12 @@ int set_modulepath(void)
  * Create a new protocol decoder instance.
  *
  * TODO: this should be a decoder name, as decoder ids will disappear.
- * @param id Decoder 'id' field.
- * @param instance_id optional unique identifier for this instance. If NULL,
- * the id parameter is used.
  *
- * @returns Pointer to a newly allocated struct srd_decoder_instance, or
- * NULL in case of failure.
+ * @param id Decoder 'id' field.
+ * @param instance_id Optional unique identifier for this instance. If NULL,
+ *        the 'id' parameter is used.
+ * @return Pointer to a newly allocated struct srd_decoder_instance, or
+ *         NULL in case of failure.
  */
 struct srd_decoder_instance *srd_instance_new(const char *id,
                const char *instance_id)
@@ -168,7 +168,7 @@ struct srd_decoder_instance *srd_instance_new(const char *id,
        }
 
        /* Create an instance of the 'Decoder' class. */
-       di->py_instance = PyObject_Call(dec->py_decobj, py_args, NULL);
+       di->py_instance = PyObject_Call(dec->py_dec, py_args, NULL);
        if (!di->py_instance) {
                if (PyErr_Occurred())
                        PyErr_Print();
@@ -230,6 +230,7 @@ int srd_instance_set_probe(struct srd_decoder_instance *di,
        return SRD_OK;
 }
 
+/* TODO: this should go into the PD stack */
 struct srd_decoder_instance *srd_instance_find(char *instance_id)
 {
        GSList *l;
@@ -376,7 +377,7 @@ int srd_session_feed(uint64_t timeoffset, uint64_t duration, uint8_t *inbuf,
 
 
 int pd_add(struct srd_decoder_instance *di, int output_type,
-               char *protocol_id)
+               char *proto_id)
 {
        struct srd_pd_output *pdo;
 
@@ -387,7 +388,7 @@ int pd_add(struct srd_decoder_instance *di, int output_type,
        pdo->pdo_id = g_slist_length(di->pd_output);
        pdo->output_type = output_type;
        pdo->decoder = di->decoder;
-       pdo->protocol_id = g_strdup(protocol_id);
+       pdo->proto_id = g_strdup(proto_id);
        di->pd_output = g_slist_append(di->pd_output, pdo);
 
        return pdo->pdo_id;