-#define COMPATIBILITY_MODE
-// with COMPATIBILITY_MODE enabled the callback list is accessed via console.appClosed.get()
-// we remove this code after next enigma2 release... then the list should be accessed via console.appClosed ( without .get() )
-
-#ifdef COMPATIBILITY_MODE
-struct eListCompatibilityWrapper
-{
- PyObject_HEAD
- PyObject *list;
- PyObject *in_weakreflist; /* List of weak references */
-};
-
-static int
-eListCompatibilityWrapper_traverse(eListCompatibilityWrapper *self, visitproc visit, void *arg)
-{
- Py_VISIT(self->list);
- return 0;
-}
-
-static int
-eListCompatibilityWrapper_clear(eListCompatibilityWrapper *self)
-{
- Py_CLEAR(self->list);
- return 0;
-}
-
-static void
-eListCompatibilityWrapper_dealloc(eListCompatibilityWrapper* self)
-{
- eDebug("eListCompatibilityWrapper_dealloc(eListCompatibilityWrapper* self) %p", self);
- if (self->in_weakreflist != NULL)
- PyObject_ClearWeakRefs((PyObject *) self);
- eDebug("wrapper->list is %p",self->list);
- eListCompatibilityWrapper_clear(self);
- Org_Py_DECREF(self->list);
- self->ob_type->tp_free((PyObject*)self);
-}
-
-static PyObject *
-eListCompatibilityWrapper_get(eListCompatibilityWrapper *self, void *closure)
-{
- eDebug("eListCompatibilityWrapper_get(eListCompatibilityWrapper *self, void *closure)");
- Org_Py_INCREF(self->list);
- return self->list;
-}
-
-static PyMethodDef eListCompatibilityWrapper_methods[] = {
- {"get", (PyCFunction)eListCompatibilityWrapper_get, METH_NOARGS,
- "returns the list"
- },
- {NULL} /* Sentinel */
-};
-
-static PyGetSetDef eListCompatibilityWrapper_getseters[] = {
- {NULL} /* Sentinel */
-};
-
-static PyTypeObject eListCompatibilityWrapperType = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
- "eConsoleImpl.eListCompatibilityWrapper", /*tp_name*/
- sizeof(eListCompatibilityWrapper), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- (destructor)eListCompatibilityWrapper_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash */
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- "eListCompatibilityWrapper objects", /* tp_doc */
- (traverseproc)eListCompatibilityWrapper_traverse, /* tp_traverse */
- (inquiry)eListCompatibilityWrapper_clear, /* tp_clear */
- 0, /* tp_richcompare */
- offsetof(eListCompatibilityWrapper, in_weakreflist), /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- eListCompatibilityWrapper_methods, /* tp_methods */
- 0, /* tp_members */
- eListCompatibilityWrapper_getseters, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
-static PyObject *
-eConsolePy_dataAvail(eConsolePy *self, void *closure)
-{
- eListCompatibilityWrapper *wrapper = (eListCompatibilityWrapper *)eListCompatibilityWrapperType.tp_alloc(&eListCompatibilityWrapperType, 0);
- Org_Py_INCREF((PyObject*)wrapper);
- wrapper->list = self->cont->dataAvail.get();
- wrapper->in_weakreflist = NULL;
- return (PyObject*)wrapper;
-}
-
-static PyObject *
-eConsolePy_stdoutAvail(eConsolePy *self, void *closure)
-{
- eListCompatibilityWrapper *wrapper = (eListCompatibilityWrapper *)eListCompatibilityWrapperType.tp_alloc(&eListCompatibilityWrapperType, 0);
- Org_Py_INCREF((PyObject*)wrapper);
- wrapper->list = self->cont->stdoutAvail.get();
- wrapper->in_weakreflist = NULL;
- return (PyObject*)wrapper;
-}
-
-static PyObject *
-eConsolePy_stderrAvail(eConsolePy *self, void *closure)
-{
- eListCompatibilityWrapper *wrapper = (eListCompatibilityWrapper *)eListCompatibilityWrapperType.tp_alloc(&eListCompatibilityWrapperType, 0);
- Org_Py_INCREF((PyObject*)wrapper);
- wrapper->list = self->cont->stderrAvail.get();
- wrapper->in_weakreflist = NULL;
- return (PyObject*)wrapper;
-}
-
-static PyObject *
-eConsolePy_dataSent(eConsolePy *self, void *closure)
-{
- eListCompatibilityWrapper *wrapper = (eListCompatibilityWrapper *)eListCompatibilityWrapperType.tp_alloc(&eListCompatibilityWrapperType, 0);
- Org_Py_INCREF((PyObject*)wrapper);
- wrapper->list = self->cont->dataSent.get();
- wrapper->in_weakreflist = NULL;
- return (PyObject*)wrapper;
-}
-
-static PyObject *
-eConsolePy_appClosed(eConsolePy *self, void *closure)
-{
- eListCompatibilityWrapper *wrapper = (eListCompatibilityWrapper *)eListCompatibilityWrapperType.tp_alloc(&eListCompatibilityWrapperType, 0);
- Org_Py_INCREF((PyObject*)wrapper);
- wrapper->list = self->cont->appClosed.get();
- wrapper->in_weakreflist = NULL;
- return (PyObject*)wrapper;
-}
-#else