diff options
author | Francois Pons <fpons@mandriva.com> | 1999-12-08 18:58:45 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 1999-12-08 18:58:45 +0000 |
commit | 1934b3123c81c2ccb425626aa61ed29e38780ddf (patch) | |
tree | c66e075fb0a7ffa7f7cd6f53a65e015ec864b855 /perl-install/c/stuff.xs.pm | |
parent | 1cf2e9bf3d2dd8e82380afdcf3cb8f68c6285dcc (diff) | |
download | drakx-backup-do-not-use-1934b3123c81c2ccb425626aa61ed29e38780ddf.tar drakx-backup-do-not-use-1934b3123c81c2ccb425626aa61ed29e38780ddf.tar.gz drakx-backup-do-not-use-1934b3123c81c2ccb425626aa61ed29e38780ddf.tar.bz2 drakx-backup-do-not-use-1934b3123c81c2ccb425626aa61ed29e38780ddf.tar.xz drakx-backup-do-not-use-1934b3123c81c2ccb425626aa61ed29e38780ddf.zip |
*** empty log message ***
Diffstat (limited to 'perl-install/c/stuff.xs.pm')
-rw-r--r-- | perl-install/c/stuff.xs.pm | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm index 092b136d3..6ca1e32d3 100644 --- a/perl-install/c/stuff.xs.pm +++ b/perl-install/c/stuff.xs.pm @@ -251,7 +251,7 @@ rpmdbTraverse(db, ...) } count = 0; num = rpmdbFirstRecNum(db); - while (num) { + while (num>0) { if (callback != &PL_sv_undef && SvROK(callback)) { h = rpmdbGetRecord(db, num); { @@ -623,19 +623,37 @@ headerGetEntry_int(h, query) RETVAL void +headerGetEntry_int_list(h, query) + void *h + int query + PPCODE: + int i, type, count = 0; + int_32 *intlist = (void **) NULL; + if (headerGetEntry((Header) h, query, &type, (void**) &intlist, &count)) { + if (count > 0) { + EXTEND(SP, count); + for (i = 0; i < count; i++) { + PUSHs(sv_2mortal(newSViv(intlist[i]))); + } + } + } + +void headerGetEntry_string_list(h, query) void *h int query PPCODE: int i, type, count = 0; char **strlist = (char **) NULL; - if (headerGetEntry((Header) h, query, &type, (void**) &strlist, &count) && count) { - EXTEND(SP, count); - for (i = 0; i < count; i++) { - PUSHs(sv_2mortal(newSVpv(strlist[i], 0))); + if (headerGetEntry((Header) h, query, &type, (void**) &strlist, &count)) { + if (count > 0) { + EXTEND(SP, count); + for (i = 0; i < count; i++) { + PUSHs(sv_2mortal(newSVpv(strlist[i], 0))); + } } + free(strlist); } - free(strlist); '; @macros = ( @@ -645,7 +663,7 @@ headerGetEntry_string_list(h, query) VT_ACTIVATE VT_WAITACTIVE VT_GETSTATE CDROM_LOCKDOOR CDROMEJECT ) ], ); -push @macros, [ qw(int RPMTAG_NAME RPMTAG_GROUP RPMTAG_SIZE RPMTAG_VERSION RPMTAG_SUMMARY RPMTAG_DESCRIPTION RPMTAG_RELEASE RPMTAG_ARCH RPMTAG_FILENAMES RPMTAG_OBSOLETES RPMTAG_REQUIRENAME) ] +push @macros, [ qw(int RPMTAG_NAME RPMTAG_GROUP RPMTAG_SIZE RPMTAG_VERSION RPMTAG_SUMMARY RPMTAG_DESCRIPTION RPMTAG_RELEASE RPMTAG_ARCH RPMTAG_FILENAMES RPMTAG_OBSOLETES RPMTAG_REQUIRENAME RPMTAG_FILEFLAGS RPMFILE_CONFIG) ] if $ENV{C_RPM}; $\= "\n"; |