summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-10-01 15:25:01 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-10-01 15:25:01 +0300
commit1dffab5393fc8ed5cd81173be543db6b5c34785a (patch)
treeb0feebefffde7b5cdfe41f9b49c13f564c0d76ab
parent9c88ea2c87b5d22026400fb19f064b7967aa4743 (diff)
downloadlibrpm-tizen-1dffab5393fc8ed5cd81173be543db6b5c34785a.tar.gz
librpm-tizen-1dffab5393fc8ed5cd81173be543db6b5c34785a.tar.bz2
librpm-tizen-1dffab5393fc8ed5cd81173be543db6b5c34785a.zip
Add python method for retrieving header "instance" (db recno) number
-rw-r--r--python/header-py.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/header-py.c b/python/header-py.c
index 008194073..d87e1fef9 100644
--- a/python/header-py.c
+++ b/python/header-py.c
@@ -239,6 +239,11 @@ static PyObject * hdrFormat(hdrObject * s, PyObject * args, PyObject * kwds)
return result;
}
+static PyObject *hdrInstance(hdrObject *s)
+{
+ return Py_BuildValue("i", headerGetInstance(s->h));
+}
+
static PyObject *hdrIsSource(hdrObject *s)
{
return PyBool_FromLong(headerIsSource(s->h));
@@ -321,6 +326,8 @@ static struct PyMethodDef hdr_methods[] = {
NULL },
{"sprintf", (PyCFunction) hdrFormat, METH_VARARGS|METH_KEYWORDS,
NULL },
+ {"instance", (PyCFunction)hdrInstance, METH_NOARGS,
+ NULL },
{"isSource", (PyCFunction)hdrIsSource, METH_NOARGS,
NULL },
{"write", (PyCFunction)hdrWrite, METH_VARARGS|METH_KEYWORDS,