diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-09-30 12:11:43 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-09-30 12:11:43 +0300 |
commit | b53f5995969554211dde0b235c648f8d2e1cb0a6 (patch) | |
tree | cd4630c75f8bbfbcbf42a382bd369b5788f32fb7 /python/rpmds-py.c | |
parent | 945bbf49f52c50b53f0d407e91ec46febd56d948 (diff) | |
download | librpm-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.c | 13 |
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)); } |