summaryrefslogtreecommitdiffstats
path: root/types.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2008-10-31 10:13:45 +0000
committerDaniel Veillard <veillard@redhat.com>2008-10-31 10:13:45 +0000
commit000818421b5007e1ee65c3fa8fef12bcf08feea2 (patch)
tree2dfd825507d5c75d1ee393bf229706f48dcf2f56 /types.c
parent494cd4b4c291391cc5f4f3c20e4f60667c1dd2fb (diff)
downloadlibvirt-python-split-000818421b5007e1ee65c3fa8fef12bcf08feea2.tar.gz
libvirt-python-split-000818421b5007e1ee65c3fa8fef12bcf08feea2.tar.xz
libvirt-python-split-000818421b5007e1ee65c3fa8fef12bcf08feea2.zip
* 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
Diffstat (limited to 'types.c')
-rw-r--r--types.c47
1 files changed, 47 insertions, 0 deletions
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);
+}