+
+ return NULL; /* TODO: More specific error? */
+ }
+
+ /* Create an instance of the 'Decoder' class. */
+ di->py_instance = PyObject_Call(dec->py_decobj, py_args, NULL);
+ if (!di->py_instance) {
+ if (PyErr_Occurred())
+ PyErr_Print(); /* Returns void. */
+ Py_XDECREF(py_args);
+ return NULL; /* TODO: More specific error? */
+ }
+
+ /* Append to list of PD instances */
+ decoders = g_slist_append(decoders, di);
+
+ Py_XDECREF(py_args);
+
+ return di;
+}
+
+int srd_instance_set_probe(struct srd_decoder_instance *di,
+ const char *probename, int num)
+{
+ PyObject *probedict, *probenum;
+
+ probedict = PyObject_GetAttrString(di->py_instance, "probes"); /* NEWREF */
+ if (!probedict) {
+ if (PyErr_Occurred())
+ PyErr_Print(); /* Returns void. */
+