diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2008-03-02 23:29:29 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2008-03-02 23:29:29 +0000 |
commit | 3a87f677733ffb649775d19a23f7d6d1602c7836 (patch) | |
tree | 0856e06c0e9cad228b7fc57f43c1ac4935b5265f /rpm5compat.h | |
parent | 5b7606f1b1f57b126b19431741f961a5a96aea8f (diff) | |
download | perl-URPM-3a87f677733ffb649775d19a23f7d6d1602c7836.tar perl-URPM-3a87f677733ffb649775d19a23f7d6d1602c7836.tar.gz perl-URPM-3a87f677733ffb649775d19a23f7d6d1602c7836.tar.bz2 perl-URPM-3a87f677733ffb649775d19a23f7d6d1602c7836.tar.xz perl-URPM-3a87f677733ffb649775d19a23f7d6d1602c7836.zip |
more fixes, makes apt-get build succesfully :D
Diffstat (limited to 'rpm5compat.h')
-rw-r--r-- | rpm5compat.h | 31 |
1 files 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); } |