summaryrefslogtreecommitdiffstats
path: root/libvir.c
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.c
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.c')
-rw-r--r--libvir.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/libvir.c b/libvir.c
new file mode 100644
index 0000000..7dc5100
--- /dev/null
+++ b/libvir.c
@@ -0,0 +1,41 @@
+/*
+ * libvir.c: this modules implements the main part of the glue of the
+ * libvir library and the Python interpreter. It provides the
+ * entry points where an automatically generated stub is
+ * unpractical
+ *
+ * Copyright (C) 2005 Red Hat, Inc.
+ *
+ * Daniel Veillard <veillard@redhat.com>
+ */
+
+#include <Python.h>
+#include <libvir.h>
+#include "libvir_wrap.h"
+#include "libvir-py.h"
+
+void initlibvirmod(void);
+
+/************************************************************************
+ * *
+ * The registration stuff *
+ * *
+ ************************************************************************/
+static PyMethodDef libvirMethods[] = {
+#include "libvir-export.c"
+ {NULL, NULL, 0, NULL}
+};
+
+void
+initlibvirmod(void)
+{
+ static int initialized = 0;
+
+ if (initialized != 0)
+ return;
+
+ /* intialize the python extension module */
+ Py_InitModule((char *) "libvirmod", libvirMethods);
+
+ initialized = 1;
+}