aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2008-02-28 01:24:21 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2008-02-28 01:24:21 +0000
commit51b3df50dd8a761374841bfc91c226e35f64f3c9 (patch)
treeb59a585ac76156ad4d5cbc2fc1532f3ccfdf7d37
parent8da017baccff6f8c4bca1e136a7e5fbffab66054 (diff)
downloadperl-URPM-51b3df50dd8a761374841bfc91c226e35f64f3c9.tar
perl-URPM-51b3df50dd8a761374841bfc91c226e35f64f3c9.tar.gz
perl-URPM-51b3df50dd8a761374841bfc91c226e35f64f3c9.tar.bz2
perl-URPM-51b3df50dd8a761374841bfc91c226e35f64f3c9.tar.xz
perl-URPM-51b3df50dd8a761374841bfc91c226e35f64f3c9.zip
add wrapper function for headerModifyEntry
-rw-r--r--rpm5compat.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/rpm5compat.h b/rpm5compat.h
index 9d6fd7b..f89d721 100644
--- a/rpm5compat.h
+++ b/rpm5compat.h
@@ -54,6 +54,7 @@ static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void ** p, h
static int headerAddEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c) {
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
+
he->tag = tag;
he->t = type;
he->p.str = p;
@@ -64,10 +65,21 @@ static int headerAddEntry(Header h, int_32 tag, int_32 type, const void * p, int
static int headerRemoveEntry(Header h, int_32 tag) {
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
- he->tag = (rpmTag)tag;
+ he->tag = tag;
return headerDel(h, he, 0);
}
+int headerModifyEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c) {
+ HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
+
+ he->tag = tag;
+ he->t = type;
+ he->p.str = p;
+ he->c = c;
+ return headerMod(h, he, 0);
+
+}
+
static int headerNextIterator(HeaderIterator hi, hTAG_t tag, hTYP_t type, hPTR_t * p, hCNT_t c) {
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
headerNext(hi, he, 0);