-// printf("put object %x\n", self);
-
- if (!PyArg_ParseTuple(args, "O:put", &arg))
- return NULL;
-
- // fprintf(stdout, "sigrok.put() called by decoder:\n");
- PyObject_Print(arg, stdout, Py_PRINT_RAW);
- puts("");
-
- Py_RETURN_NONE;
-}
-
-static PyMethodDef no_methods[] = { {NULL, NULL, 0, NULL} };
-static PyMethodDef Decoder_methods[] = {
- {"__init__", Decoder_init, METH_VARARGS, ""},
- {"put", Decoder_put, METH_VARARGS,
- "Accepts a dictionary with the following keys: time, duration, data"},
- {NULL, NULL, 0, NULL}
-};
-
-
-// class Decoder(sigrok.Decoder):
-typedef struct {
- PyObject_HEAD
-} sigrok_Decoder_object;
-
-static PyTypeObject sigrok_Decoder_type = {
- PyObject_HEAD_INIT(NULL)
- .tp_name = "sigrok.Decoder",
- .tp_basicsize = sizeof(sigrok_Decoder_object),
- .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_doc = "Sigrok Decoder object",
- .tp_methods = Decoder_methods,
-};
-
-PyMODINIT_FUNC init_sigrok_Decoder(void)
-{
- PyObject *mod;
-
- sigrok_Decoder_type.tp_new = PyType_GenericNew;
- if (PyType_Ready(&sigrok_Decoder_type) < 0)
- return;
-
- mod = Py_InitModule3("sigrok", no_methods, "sigrok base classes");
- Py_INCREF(&sigrok_Decoder_type);
- PyModule_AddObject(mod, "Decoder", (PyObject *)&sigrok_Decoder_type);
-
-}