Add rpmdsPutToHeader function to to API

This commit is contained in:
Florian Festi 2014-04-10 09:58:55 +02:00
parent ace39f7bf5
commit 44acd3f63f
2 changed files with 26 additions and 0 deletions

View File

@ -381,6 +381,24 @@ rpmds rpmdsCurrent(rpmds ds)
return cds;
}
int rpmdsPutToHeader(rpmds ds, Header h)
{
rpmTagVal tagN = rpmdsTagN(ds);
rpmTagVal tagEVR = rpmdsTagEVR(ds);
rpmTagVal tagF = rpmdsTagF(ds);
if (!tagN)
return -1;
rpmds pi = rpmdsInit(ds);
while (rpmdsNext(pi) >= 0) {
rpmsenseFlags flags = rpmdsFlags(pi);
headerPutString(h, tagN, rpmdsN(pi));
headerPutString(h, tagEVR, rpmdsEVR(pi));
headerPutUint32(h, tagF, &flags, 1);
}
return 0;
}
int rpmdsCount(const rpmds ds)
{
return (ds != NULL ? ds->Count : 0);

View File

@ -142,6 +142,14 @@ rpmds rpmdsSingle(rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlag
*/
rpmds rpmdsCurrent(rpmds ds);
/** \ingroup rpmds
* Write content of the dependency set to the header
* @param ds dependency set
* @param h header
* @return 0 on success
*/
int rpmdsPutToHeader(rpmds ds, Header h);
/** \ingroup rpmds
* Return dependency set count.
* @param ds dependency set