From 3a87f677733ffb649775d19a23f7d6d1602c7836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Sun, 2 Mar 2008 23:29:29 +0000 Subject: more fixes, makes apt-get build succesfully :D --- rpm5compat.h | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/rpm5compat.h b/rpm5compat.h index 60b3c38..8b6c2c4 100644 --- a/rpm5compat.h +++ b/rpm5compat.h @@ -60,14 +60,18 @@ typedef union hRET_s { typedef enum pgpVSFlags_e rpmVSFlags_e; -static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void ** p, hCNT_t c){ +#ifdef __cplusplus +extern "C" { +#endif + +static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void ** p, hCNT_t c) { HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); int rc; /* Always ensure to initialize */ *(void **)p = NULL; he->tag = (rpmTag)tag; - rc = headerGet(h, he, tag); + rc = headerGet(h, he, 0); if (rc) { if (type) *type = he->t; if (p) *(void **) p = he->p.ptr; @@ -77,6 +81,27 @@ static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void ** p, h return rc; } + +inline int headerGetRawEntry(Header h, int_32 tag, hTYP_t type, void * p, hCNT_t c) { + HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); + int rc; + + he->tag = (rpmTag)tag; + he->t = *(rpmTagType*)type; + he->p.str = (const char*)p; + he->c = *(rpmTagCount*)c; + + rc = headerGet(h, he, tag); + + if (rc) { + if (type) *type = he->t; + if (p) *(void **) p = he->p.ptr; + if (c) *c = he->c; + } + + return rc; +} + static inline int headerAddEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c) { HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); @@ -164,6 +189,8 @@ inline int rpmMachineScore(int type, const char * name) { } #ifdef __cplusplus +} + inline rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, int_32 Flags){ return rpmdsSingle(tagN, N, EVR, (evrFlags)Flags); } -- cgit v1.2.1