summaryrefslogtreecommitdiffstats
path: root/libvir_wrap.h
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2005-12-19 16:34:11 +0000
committerDaniel Veillard <veillard@redhat.com>2005-12-19 16:34:11 +0000
commit30f666b9f47f36348e0cbb6a3bca011d9cd0bc76 (patch)
treefb79a83e8d784ef1fb1d6a248084a4c04a593c65 /libvir_wrap.h
downloadlibvirt-python-split-30f666b9f47f36348e0cbb6a3bca011d9cd0bc76.tar.gz
libvirt-python-split-30f666b9f47f36348e0cbb6a3bca011d9cd0bc76.tar.xz
libvirt-python-split-30f666b9f47f36348e0cbb6a3bca011d9cd0bc76.zip
* Makefile.am configure.in libvir.spec.in python/*: added a firstv0.0.1
version for python bindings, heavilly based on libxml2/libxslt way of doing things, maybe this need to be revisited. Added packaging too. * src/hash.h: fixed the Copyright notice. Daniel
Diffstat (limited to 'libvir_wrap.h')
-rw-r--r--libvir_wrap.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/libvir_wrap.h b/libvir_wrap.h
new file mode 100644
index 0000000..31771d7
--- /dev/null
+++ b/libvir_wrap.h
@@ -0,0 +1,48 @@
+/*
+ * libvir_wrap.h: type wrappers for libvir python bindings
+ *
+ * Copyright (C) 2005 Red Hat, Inc.
+ *
+ * Daniel Veillard <veillard@redhat.com>
+ */
+
+#include <Python.h>
+#include <libvir.h>
+
+#ifdef __GNUC__
+#ifdef ATTRIBUTE_UNUSED
+#undef ATTRIBUTE_UNUSED
+#endif
+#ifndef ATTRIBUTE_UNUSED
+#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#endif /* ATTRIBUTE_UNUSED */
+#else
+#define ATTRIBUTE_UNUSED
+#endif
+
+#define PyvirConnect_Get(v) (((v) == Py_None) ? NULL : \
+ (((PyvirConnect_Object *)(v))->obj))
+
+typedef struct {
+ PyObject_HEAD
+ virConnectPtr obj;
+} PyvirConnect_Object;
+
+
+#define PyvirDomain_Get(v) (((v) == Py_None) ? NULL : \
+ (((PyvirDomain_Object *)(v))->obj))
+
+typedef struct {
+ PyObject_HEAD
+ virDomainPtr obj;
+} PyvirDomain_Object;
+
+
+PyObject * libvir_intWrap(int val);
+PyObject * libvir_longWrap(long val);
+PyObject * libvir_charPtrWrap(char *str);
+PyObject * libvir_constcharPtrWrap(const char *str);
+PyObject * libvir_charPtrConstWrap(const char *str);
+PyObject * libvir_virConnectPtrWrap(virConnectPtr node);
+PyObject * libvir_virDomainPtrWrap(virDomainPtr node);
+