aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-13 18:43:47 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-13 18:43:47 +0000
commita1aca896446d2aa929d782822c4d6c79c1c34634 (patch)
tree328aae08131687ebaa5e786f78d8eff4438a08ca /URPM.xs
parent8a45f99d043edd26fc9d20f4a351440b4dfbd7f8 (diff)
downloadperl-URPM-a1aca896446d2aa929d782822c4d6c79c1c34634.tar
perl-URPM-a1aca896446d2aa929d782822c4d6c79c1c34634.tar.gz
perl-URPM-a1aca896446d2aa929d782822c4d6c79c1c34634.tar.bz2
perl-URPM-a1aca896446d2aa929d782822c4d6c79c1c34634.tar.xz
perl-URPM-a1aca896446d2aa929d782822c4d6c79c1c34634.zip
use proper rpm types
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs57
1 files changed, 30 insertions, 27 deletions
diff --git a/URPM.xs b/URPM.xs
index 194950a..a60ea67 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -149,7 +149,7 @@ get_fullname_parts(URPM__Package pkg, char **name, char **version, char **releas
}
static char *
-get_name(Header header, int32_t tag) {
+get_name(Header header, rpmTag tag) {
struct rpmtd_s val;
headerGet(header, tag, &val, HEADERGET_MINMEM);
@@ -163,7 +163,7 @@ get_arch(Header header) {
}
static int
-get_int(Header header, int32_t tag) {
+get_int(Header header, rpmTag tag) {
struct rpmtd_s val;
headerGet(header, tag, &val, HEADERGET_DEFAULT);
@@ -177,7 +177,7 @@ get_filesize(const Header h) {
}
static int
-print_list_entry(char *buff, int sz, const char *name, uint32_t flags, const char *evr) {
+print_list_entry(char *buff, int sz, const char *name, rpmsenseFlags flags, const char *evr) {
int len = strlen(name);
char *p = buff;
@@ -208,7 +208,7 @@ print_list_entry(char *buff, int sz, const char *name, uint32_t flags, const cha
}
static int
-ranges_overlap(uint32_t aflags, char *sa, uint32_t bflags, char *sb, int b_nopromote) {
+ranges_overlap(rpmsenseFlags aflags, char *sa, rpmsenseFlags bflags, char *sb, int b_nopromote) {
if (!aflags || !bflags)
return 1; /* really faster to test it there instead of later */
else {
@@ -273,20 +273,20 @@ ranges_overlap(uint32_t aflags, char *sa, uint32_t bflags, char *sb, int b_nopro
}
}
-static int has_old_suggests;
-int32_t is_old_suggests(int32_t flags) {
- int is = flags & RPMSENSE_MISSINGOK;
+static rpmsenseFlags has_old_suggests;
+rpmsenseFlags is_old_suggests(rpmsenseFlags flags) {
+ rpmsenseFlags is = flags & RPMSENSE_MISSINGOK;
if (is) has_old_suggests = is;
return is;
}
-int32_t is_not_old_suggests(int32_t flags) {
+rpmsenseFlags is_not_old_suggests(rpmsenseFlags flags) {
return !is_old_suggests(flags);
}
-typedef int (*callback_list_str)(char *s, int slen, const char *name, const uint32_t flags, const char *evr, void *param);
+typedef int (*callback_list_str)(char *s, int slen, const char *name, const rpmsenseFlags flags, const char *evr, void *param);
static int
-callback_list_str_xpush(char *s, int slen, const char *name, uint32_t flags, const char *evr, __attribute__((unused)) void *param) {
+callback_list_str_xpush(char *s, int slen, const char *name, rpmsenseFlags flags, const char *evr, __attribute__((unused)) void *param) {
dSP;
if (s)
mXPUSHs(newSVpv(s, slen));
@@ -301,7 +301,7 @@ callback_list_str_xpush(char *s, int slen, const char *name, uint32_t flags, con
return 0;
}
static int
-callback_list_str_xpush_requires(char *s, int slen, const char *name, const uint32_t flags, const char *evr, __attribute__((unused)) void *param) {
+callback_list_str_xpush_requires(char *s, int slen, const char *name, const rpmsenseFlags flags, const char *evr, __attribute__((unused)) void *param) {
dSP;
if (s)
mXPUSHs(newSVpv(s, slen));
@@ -316,7 +316,7 @@ callback_list_str_xpush_requires(char *s, int slen, const char *name, const uint
return 0;
}
static int
-callback_list_str_xpush_old_suggests(char *s, int slen, const char *name, uint32_t flags, const char *evr, __attribute__((unused)) void *param) {
+callback_list_str_xpush_old_suggests(char *s, int slen, const char *name, rpmsenseFlags flags, const char *evr, __attribute__((unused)) void *param) {
dSP;
if (s)
mXPUSHs(newSVpv(s, slen));
@@ -333,14 +333,14 @@ callback_list_str_xpush_old_suggests(char *s, int slen, const char *name, uint32
struct cb_overlap_s {
char *name;
- int32_t flags;
+ rpmsenseFlags flags;
char *evr;
int direction; /* indicate to compare the above at left or right to the iteration element */
int b_nopromote;
};
static int
-callback_list_str_overlap(char *s, int slen, const char *name, uint32_t flags, const char *evr, void *param) {
+callback_list_str_overlap(char *s, int slen, const char *name, rpmsenseFlags flags, const char *evr, void *param) {
struct cb_overlap_s *os = (struct cb_overlap_s *)param;
int result = 0;
char *eos = NULL;
@@ -390,7 +390,7 @@ callback_list_str_overlap(char *s, int slen, const char *name, uint32_t flags, c
}
static int
-return_list_str(char *s, Header header, int32_t tag_name, int32_t tag_flags, int32_t tag_version, callback_list_str f, void *param) {
+return_list_str(char *s, Header header, rpmTag tag_name, rpmTag tag_flags, rpmTag tag_version, callback_list_str f, void *param) {
int count = 0;
if (s != NULL) {
@@ -444,7 +444,7 @@ return_list_str(char *s, Header header, int32_t tag_name, int32_t tag_flags, int
}
static int
-xpush_simple_list_str(Header header, int32_t tag_name) {
+xpush_simple_list_str(Header header, rpmTag tag_name) {
dSP;
if (header) {
struct rpmtd_s list;
@@ -464,7 +464,7 @@ xpush_simple_list_str(Header header, int32_t tag_name) {
}
void
-return_list_int32_t(Header header, int32_t tag_name) {
+return_list_int32_t(Header header, rpmTag tag_name) {
dSP;
if (header) {
struct rpmtd_s list;
@@ -480,7 +480,7 @@ return_list_int32_t(Header header, int32_t tag_name) {
}
void
-return_list_uint_16(Header header, int32_t tag_name) {
+return_list_uint_16(Header header, rpmTag tag_name) {
dSP;
if (header) {
struct rpmtd_s list;
@@ -498,7 +498,7 @@ return_list_uint_16(Header header, int32_t tag_name) {
}
void
-return_list_tag_modifier(Header header, int32_t tag_name) {
+return_list_tag_modifier(Header header, rpmTag tag_name) {
dSP;
int i;
struct rpmtd_s td;
@@ -534,7 +534,7 @@ return_list_tag_modifier(Header header, int32_t tag_name) {
}
void
-return_list_tag(URPM__Package pkg, int32_t tag_name) {
+return_list_tag(URPM__Package pkg, rpmTag tag_name) {
dSP;
if (pkg->h != NULL) {
struct rpmtd_s td;
@@ -750,9 +750,9 @@ return_problems(rpmps ps, int translate_message, int raw_message) {
}
static char *
-pack_list(Header header, int32_t tag_name, int32_t tag_flags, int32_t tag_version, int32_t (*check_flag)(int32_t)) {
+pack_list(Header header, rpmTag tag_name, rpmTag tag_flags, rpmTag tag_version, rpmsenseFlags (*check_flag)(rpmsenseFlags)) {
char buff[65536];
- int32_t *flags = NULL;
+ rpmTag *flags = NULL;
char **list_evr = NULL;
unsigned int i;
char *p = buff;
@@ -858,7 +858,7 @@ update_provides(URPM__Package pkg, HV *provides) {
if (pkg->h) {
int len;
struct rpmtd_s td, td_flags;
- int32_t *flags = NULL;
+ rpmsenseFlags *flags = NULL;
unsigned int i;
/* examine requires for files which need to be marked in provides */
@@ -1350,7 +1350,8 @@ static void *rpmRunTransactions_callback(__attribute__((unused)) const void *h,
return callback == td->callback_open ? fd : NULL;
}
-static int rpmtag_from_string(char *tag)
+static rpmTag
+rpmtag_from_string(char *tag)
{
if (!strcmp(tag, "name"))
return RPMTAG_NAME;
@@ -1958,7 +1959,8 @@ Pkg_obsoletes_overlap(pkg, s, b_nopromote=1, direction=-1)
struct cb_overlap_s os;
char *eon = NULL;
char eonc = '\0';
- int32_t tag_name, tag_flags, tag_version;
+ rpmTag tag_name;
+ rpmTag tag_flags, tag_version;
CODE:
switch (ix) {
case 1:
@@ -2528,7 +2530,8 @@ Db_traverse_tag(db,tag,names,callback)
if (SvROK(names) && SvTYPE(SvRV(names)) == SVt_PVAV) {
AV* names_av = (AV*)SvRV(names);
int len = av_len(names_av);
- int i, rpmtag;
+ int i;
+ rpmTag rpmtag;
rpmtag = rpmtag_from_string(tag);
@@ -2577,7 +2580,7 @@ Db_traverse_tag_find(db,tag,name,callback)
Header header;
rpmdbMatchIterator mi;
CODE:
- int rpmtag = rpmtag_from_string(tag);
+ rpmTag rpmtag = rpmtag_from_string(tag);
int found = 0;
rpmVSFlags ovsflags;
db->ts = rpmtsLink(db->ts);