Introduce headerNVRD()
It's similar to headerNVR() but also returns disttag.
This commit is contained in:
parent
9618b8946f
commit
3cb012d5c3
16
lib/rpmlib.h
16
lib/rpmlib.h
@ -103,6 +103,22 @@ int headerNVR(Header h,
|
||||
/*@null@*/ /*@out@*/ const char ** rp)
|
||||
/*@modifies *np, *vp, *rp @*/;
|
||||
|
||||
/** \ingroup header
|
||||
* Return name, version, release, and disttag strings from header.
|
||||
* @param h header
|
||||
* @retval *np name pointer (or NULL)
|
||||
* @retval *vp version pointer (or NULL)
|
||||
* @retval *rp release pointer (or NULL)
|
||||
* @retval *dp disttag pointer (or NULL)
|
||||
* @return 0 always
|
||||
*/
|
||||
int headerNVRD(Header h,
|
||||
/*@null@*/ /*@out@*/ const char ** np,
|
||||
/*@null@*/ /*@out@*/ const char ** vp,
|
||||
/*@null@*/ /*@out@*/ const char ** rp,
|
||||
/*@null@*/ /*@out@*/ const char ** dp)
|
||||
/*@modifies *np, *vp, *rp, *dp @*/;
|
||||
|
||||
/** \ingroup header
|
||||
* Return name, epoch, version, release, arch strings from header.
|
||||
* @param h header
|
||||
|
@ -6,7 +6,8 @@
|
||||
#include "rpmlib.h"
|
||||
#include "debug.h"
|
||||
|
||||
int headerNVR(Header h, const char **np, const char **vp, const char **rp)
|
||||
int headerNVRD(Header h, const char **np, const char **vp, const char **rp,
|
||||
const char **dp)
|
||||
{
|
||||
int type;
|
||||
int count;
|
||||
@ -27,10 +28,20 @@ int headerNVR(Header h, const char **np, const char **vp, const char **rp)
|
||||
&& type == RPM_STRING_TYPE && count == 1))
|
||||
*rp = NULL;
|
||||
}
|
||||
if (dp) {
|
||||
if (!(headerGetEntry(h, RPMTAG_DISTTAG, &type, (void **) dp, &count)
|
||||
&& type == RPM_STRING_TYPE && count == 1))
|
||||
*dp = NULL;
|
||||
}
|
||||
/*@=boundswrite@*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
int headerNVR(Header h, const char **np, const char **vp, const char **rp)
|
||||
{
|
||||
return headerNVRD(h, np, vp, rp, NULL);
|
||||
}
|
||||
|
||||
int headerNEVRA(Header h, const char **np,
|
||||
/*@unused@*/ const char **ep, const char **vp, const char **rp,
|
||||
const char **ap)
|
||||
|
Loading…
Reference in New Issue
Block a user