From 000818421b5007e1ee65c3fa8fef12bcf08feea2 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Fri, 31 Oct 2008 10:13:45 +0000 Subject: * python/Makefile.am python/generator.py python/libvir.c python/libvir.py python/libvirt_wrap.h python/types.c: adds support for events from the python bindings, also improves the generator allowing to embbed per function definition files, patch by Ben Guthro * examples/domain-events/events-python/event-test.py: also adds a programming example Daniel --- types.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'types.c') diff --git a/types.c b/types.c index 8e08d25..1c1db89 100644 --- a/types.c +++ b/types.c @@ -162,3 +162,50 @@ libvirt_virConnectPtrWrap(virConnectPtr node) NULL); return (ret); } + +PyObject * +libvirt_virEventHandleCallbackWrap(virEventHandleCallback node) +{ + PyObject *ret; + + if (node == NULL) { + Py_INCREF(Py_None); + printf("%s: WARNING - Wrapping None\n", __FUNCTION__); + return (Py_None); + } + ret = + PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virEventHandleCallback", + NULL); + return (ret); +} + +PyObject * +libvirt_virEventTimeoutCallbackWrap(virEventTimeoutCallback node) +{ + PyObject *ret; + + if (node == NULL) { + printf("%s: WARNING - Wrapping None\n", __FUNCTION__); + Py_INCREF(Py_None); + return (Py_None); + } + ret = + PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virEventTimeoutCallback", + NULL); + return (ret); +} + +PyObject * +libvirt_virVoidPtrWrap(void* node) +{ + PyObject *ret; + + if (node == NULL) { + Py_INCREF(Py_None); + return (Py_None); + } + ret = + PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "void*", + NULL); + return (ret); +} -- cgit