aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-13 18:44:18 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-13 18:44:18 +0000
commit38b88ed85d9d472c62209370f94ce82b3eb80c15 (patch)
tree609edcb899825cd778bdb99cf7c639701118f4ac /URPM.xs
parent1869caccae3a2edd6cceb75e92e471169f0c6b64 (diff)
downloadperl-URPM-38b88ed85d9d472c62209370f94ce82b3eb80c15.tar
perl-URPM-38b88ed85d9d472c62209370f94ce82b3eb80c15.tar.gz
perl-URPM-38b88ed85d9d472c62209370f94ce82b3eb80c15.tar.bz2
perl-URPM-38b88ed85d9d472c62209370f94ce82b3eb80c15.tar.xz
perl-URPM-38b88ed85d9d472c62209370f94ce82b3eb80c15.zip
(return_list_tag) use proper accessors
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs14
1 files changed, 7 insertions, 7 deletions
diff --git a/URPM.xs b/URPM.xs
index 19457b0..65f8e27 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -487,10 +487,10 @@ return_list_uint_16(const Header header, rpmTag tag_name) {
if (headerGet(header, tag_name, &list, HEADERGET_DEFAULT)) {
int count = rpmtdCount(&list);
int i;
- uint16_t *list_ = list.data;
EXTEND(SP, count);
for(i = 0; i < count; i++) {
- mPUSHs(newSViv(list_[i]));
+ rpmtdNext(&list);
+ mPUSHs(newSViv(rpmtdGetNumber(&list)));
}
rpmtdFreeData(&list);
}
@@ -554,25 +554,25 @@ return_list_tag(const URPM__Package pkg, rpmTag tag_name) {
case RPM_INT32_TYPE:
{
int i;
- int *r = (int *)list;
EXTEND(SP, count);
for (i=0; i < count; i++) {
- mPUSHs(newSViv(r[i]));
+ rpmtdNext(&td);
+ mPUSHs(newSViv(rpmtdGetNumber(&td)));
}
}
break;
case RPM_STRING_TYPE:
- mXPUSHs(newSVpv((char *) list, 0));
+ mPUSHs(newSVpv(rpmtdGetString(&td), 0));
break;
case RPM_BIN_TYPE:
break;
case RPM_STRING_ARRAY_TYPE:
{
int i;
- char **s = (char **)list;
EXTEND(SP, count);
+ rpmtdInit(&td);
for (i = 0; i < count; i++)
- mPUSHs(newSVpv(s[i], 0));
+ mPUSHs(newSVpv(rpmtdNextString(&td), 0));
}
break;
case RPM_I18NSTRING_TYPE: