+static int _unitsize = 1;
+
+static PyObject*
+emb_getmeta(PyObject *self, PyObject *args)
+{
+ if (!PyArg_ParseTuple(args, ":get"))
+ return NULL;
+
+ return Py_BuildValue("{sssisd}",
+ "driver", "demo",
+ "unitsize", _unitsize,
+ "starttime", 129318231823.0 //TODO: Fill with something reasonable.
+ );
+}
+
+#if 0
+static PyObject*
+emb_get(PyObject *self, PyObject *args)
+{
+ PyObject *r;
+ if (!PyArg_ParseTuple(args, ":get"))
+ return NULL;
+
+ fprintf(stderr, "get called, returns %d\n", _bufoffset);
+ if ((_bufoffset + _unitsize) <= _buflen) {
+ r = Py_BuildValue("{sisiss#}",
+ "time", _bufoffset / _unitsize,
+ "duration", 10,
+ "data", &_buf[_bufoffset], _unitsize
+ );
+ _bufoffset += _unitsize;
+ return r;
+ }
+ Py_RETURN_NONE;
+}
+#endif
+
+static PyObject*
+emb_put(PyObject *self, PyObject *args)
+{
+ PyObject *arg;
+
+ if (!PyArg_ParseTuple(args, "O:put", &arg))
+ return NULL;
+
+ fprintf(stderr, "put called, got passed %d\n", arg);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef EmbMethods[] = {
+ {"get_meta", emb_getmeta, METH_VARARGS,
+ "Returns information about the stream."},
+ /*{"get", emb_get, METH_VARARGS,
+ "Returns a dictionary with the following keys: time, duration, data"},*/
+ {"put", emb_put, METH_VARARGS,
+ "Accepts a dictionary with the following keys: time, duration, data"},
+ {NULL, NULL, 0, NULL}
+};
+