summaryrefslogtreecommitdiff
path: root/python/rpmds-py.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-30 12:11:43 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-30 12:11:43 +0300
commitb53f5995969554211dde0b235c648f8d2e1cb0a6 (patch)
treecd4630c75f8bbfbcbf42a382bd369b5788f32fb7 /python/rpmds-py.c
parent945bbf49f52c50b53f0d407e91ec46febd56d948 (diff)
downloadlibrpm-tizen-b53f5995969554211dde0b235c648f8d2e1cb0a6.tar.gz
librpm-tizen-b53f5995969554211dde0b235c648f8d2e1cb0a6.tar.bz2
librpm-tizen-b53f5995969554211dde0b235c648f8d2e1cb0a6.zip
Turn hdrGetHeader() into argument parsing converter interface
Diffstat (limited to 'python/rpmds-py.c')
-rw-r--r--python/rpmds-py.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/python/rpmds-py.c b/python/rpmds-py.c
index ab227c41d..67904ba9a 100644
--- a/python/rpmds-py.c
+++ b/python/rpmds-py.c
@@ -418,17 +418,17 @@ static int rpmds_init(rpmdsObject * s, PyObject *args, PyObject *kwds)
static PyObject * rpmds_new(PyTypeObject * subtype, PyObject *args, PyObject *kwds)
{
- hdrObject * ho = NULL;
+ Header h = NULL;
rpmTag tagN = RPMTAG_REQUIRENAME;
rpmsenseFlags flags = 0;
rpmds ds = NULL;
char * kwlist[] = {"header", "tag", "flags", NULL};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|O&i:rpmds_new", kwlist,
- &hdr_Type, &ho, tagNumFromPyObject, &tagN, &flags))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&|O&i:rpmds_new", kwlist,
+ hdrFromPyObject, &h, tagNumFromPyObject, &tagN, &flags))
return NULL;
- ds = rpmdsNew(hdrGetHeader(ho), tagN, 0);
+ ds = rpmdsNew(h, tagN, 0);
return rpmds_Wrap(subtype, ds);
}
@@ -523,9 +523,10 @@ PyObject * hdr_dsFromHeader(PyObject * s, PyObject * args, PyObject * kwds)
PyObject * hdr_dsOfHeader(PyObject * s)
{
- hdrObject * ho = (hdrObject *)s;
+ Header h = NULL;
rpmTag tagN = RPMTAG_PROVIDENAME;
rpmsenseFlags Flags = RPMSENSE_EQUAL;
+ if (!hdrFromPyObject(s, &h)) return NULL;
- return rpmds_Wrap(&rpmds_Type, rpmdsThis(hdrGetHeader(ho), tagN, Flags));
+ return rpmds_Wrap(&rpmds_Type, rpmdsThis(h, tagN, Flags));
}