summaryrefslogtreecommitdiffstats
path: root/RPM4/src
diff options
context:
space:
mode:
Diffstat (limited to 'RPM4/src')
-rw-r--r--RPM4/src/RPM4.xs37
1 files changed, 35 insertions, 2 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs
index 4bd1a6f..248d92d 100644
--- a/RPM4/src/RPM4.xs
+++ b/RPM4/src/RPM4.xs
@@ -406,6 +406,7 @@ void _newspec(rpmts ts, char * filename, SV * svpassphrase, SV * svrootdir, SV *
char * cookies = NULL;
int anyarch = 0;
int force = 0;
+ dSP;
if (svpassphrase && SvOK(svpassphrase))
passphrase = SvPV_nolen(svpassphrase);
@@ -424,7 +425,6 @@ void _newspec(rpmts ts, char * filename, SV * svpassphrase, SV * svrootdir, SV *
if (svforce && SvOK(svforce))
force = SvIV(svforce);
- dSP;
if (filename) {
if (!parseSpec(ts, filename, rootdir, NULL, 0, passphrase, cookies, anyarch, force))
spec = rpmtsSetSpec(ts, NULL);
@@ -2848,7 +2848,40 @@ Spec_sources_url(spec, is = 0)
XPUSHs(sv_2mortal(newSVpv(dest, len)));
}
-
+void
+Spec_icon(spec)
+ Spec spec
+ PREINIT:
+ Package pkg;
+ PPCODE:
+ for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
+ char * dest = NULL;
+ int len;
+ if (!pkg->icon)
+ continue;
+ len = strlen(pkg->icon->source);
+ dest = malloc(len);
+ memcpy(dest, pkg->icon->source, len);
+ XPUSHs(sv_2mortal(newSVpv(dest, len)));
+ }
+
+void
+Spec_icon_url(spec)
+ Spec spec
+ PREINIT:
+ Package pkg;
+ PPCODE:
+ for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
+ char * dest = NULL;
+ int len;
+ if (!pkg->icon)
+ continue;
+ len = strlen(pkg->icon->fullSource);
+ dest = malloc(len);
+ memcpy(dest, pkg->icon->fullSource, len);
+ XPUSHs(sv_2mortal(newSVpv(dest, len)));
+ }
+
MODULE = RPM4 PACKAGE = RPM4::Db::_Problems PREFIX = ps_
void