From 1934b3123c81c2ccb425626aa61ed29e38780ddf Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 8 Dec 1999 18:58:45 +0000 Subject: *** empty log message *** --- perl-install/c/stuff.xs.pm | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'perl-install/c/stuff.xs.pm') 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); { @@ -622,6 +622,22 @@ headerGetEntry_int(h, query) OUTPUT: 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 @@ -629,13 +645,15 @@ headerGetEntry_string_list(h, 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"; -- cgit v1.2.1