Ugh, forgot to add the new _rpmb module to git
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 5 Oct 2009 06:26:43 +0000 (09:26 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 5 Oct 2009 06:26:43 +0000 (09:26 +0300)
- should've been in commit 8169bbde6934637ed7be58e18103330c1d5e4546

python/rpmbmodule.c [new file with mode: 0644]

diff --git a/python/rpmbmodule.c b/python/rpmbmodule.c
new file mode 100644 (file)
index 0000000..2c18ed3
--- /dev/null
@@ -0,0 +1,35 @@
+#include "rpmsystem-py.h"
+
+#include "spec-py.h"
+
+#include "debug.h"
+
+/* hmm.. figure something better */
+PyObject * pyrpmbError;
+
+static char rpmb__doc__[] =
+"";
+
+void init_rpmb(void);  /* XXX eliminate gcc warning */
+
+void init_rpmb(void)
+{
+    PyObject * d, *m;
+
+    if (PyType_Ready(&spec_Type) < 0) return;
+
+    m = Py_InitModule3("_rpmb", NULL, rpmb__doc__);
+    if (m == NULL)
+       return;
+
+    d = PyModule_GetDict(m);
+
+    pyrpmbError = PyErr_NewException("_rpmb.error", NULL, NULL);
+    if (pyrpmbError != NULL)
+       PyDict_SetItemString(d, "error", pyrpmbError);
+
+    Py_INCREF(&spec_Type);
+    PyModule_AddObject(m, "spec", (PyObject *) &spec_Type);
+
+}
+