+static GSList *list_pds = NULL;
+/* The list of protocol decoder instances: struct srd_decoder_instance */
+static GSList *decoders;
+
+/*
+ * Here's a quick overview of Python/C API reference counting.
+ *
+ * Check the Python/C API docs for what type of reference a function returns.
+ *
+ * - If it returns a "new reference", you're responsible to Py_XDECREF() it.
+ *
+ * - If it returns a "borrowed reference", you MUST NOT Py_XDECREF() it.
+ *
+ * - If a function "steals" a reference, you no longer are responsible for
+ * Py_XDECREF()ing it (someone else will do it for you at some point).
+ */
+
+static int srd_load_decoder(PyObject *py_res);
+
+static PyObject *emb_register(PyObject *self, PyObject *args)
+{
+ PyObject *arg;
+
+ (void)self;
+
+ if (!PyArg_ParseTuple(args, "O:decoder", &arg))
+ return NULL;
+
+ srd_load_decoder(arg);
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *emb_put(PyObject *self, PyObject *args)
+{
+ PyObject *arg;
+
+ (void)self;
+
+ if (!PyArg_ParseTuple(args, "O:put", &arg))
+ return NULL;
+
+ PyObject_Print(arg, stdout, Py_PRINT_RAW);
+ puts("");
+
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef EmbMethods[] = {
+ {"register", emb_register, METH_VARARGS,
+ "Register a protocol decoder object with libsigrokdecode."},
+ {"put", emb_put, METH_VARARGS,
+ "Accepts a dictionary with the following keys: time, duration, data"},
+ {NULL, NULL, 0, NULL}
+};