aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs168
1 files changed, 83 insertions, 85 deletions
diff --git a/URPM.xs b/URPM.xs
index de32a27..60f5549 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -667,107 +667,105 @@ return_list_tag_modifier(Header header, int_32 tag_name) {
char *s= buff;
switch (tag_name) {
case RPMTAG_FILEFLAGS:
- if (list[i] & RPMFILE_CONFIG) *s++ = 'c';
- if (list[i] & RPMFILE_DOC) *s++ = 'd';
- if (list[i] & RPMFILE_GHOST) *s++ = 'g';
- if (list[i] & RPMFILE_LICENSE) *s++ = 'l';
- if (list[i] & RPMFILE_ICON) *s++ = 'i';
- if (list[i] & RPMFILE_MISSINGOK) *s++ = 'm';
- if (list[i] & RPMFILE_NOREPLACE) *s++ = 'n';
- if (list[i] & RPMFILE_SPECFILE) *s++ = 'S';
- if (list[i] & RPMFILE_README) *s++ = 'R';
- if (list[i] & RPMFILE_EXCLUDE) *s++ = 'e';
- if (list[i] & RPMFILE_UNPATCHED) *s++ = 'u';
- if (list[i] & RPMFILE_PUBKEY) *s++ = 'p';
-
+ if (list[i] & RPMFILE_CONFIG) *s++ = 'c';
+ if (list[i] & RPMFILE_DOC) *s++ = 'd';
+ if (list[i] & RPMFILE_GHOST) *s++ = 'g';
+ if (list[i] & RPMFILE_LICENSE) *s++ = 'l';
+ if (list[i] & RPMFILE_ICON) *s++ = 'i';
+ if (list[i] & RPMFILE_MISSINGOK) *s++ = 'm';
+ if (list[i] & RPMFILE_NOREPLACE) *s++ = 'n';
+ if (list[i] & RPMFILE_SPECFILE) *s++ = 'S';
+ if (list[i] & RPMFILE_README) *s++ = 'R';
+ if (list[i] & RPMFILE_EXCLUDE) *s++ = 'e';
+ if (list[i] & RPMFILE_UNPATCHED) *s++ = 'u';
+ if (list[i] & RPMFILE_PUBKEY) *s++ = 'p';
break;
default:
return;
}
*s = '\0';
XPUSHs(sv_2mortal(newSVpv(buff, strlen(buff))));
- }
+ }
PUTBACK;
}
void
return_list_tag(Header header, int_32 tag_name) {
- dSP;
- if (header) {
- int_32 *list = NULL;
- uint_16 *list16;
- int_32 count, type;
- headerGetEntry(header, tag_name, &type, (void **) &list, &count);
- if (list) {
- if (count == 1 ) {
- switch (type) {
- case RPM_NULL_TYPE:
- break;
- case RPM_CHAR_TYPE:
- XPUSHs(sv_2mortal(newSVpv((char *) list,strlen((char *) list))));
- break;
- case RPM_INT8_TYPE:
- break;
- case RPM_INT16_TYPE:
- list16 = list;
- XPUSHs(sv_2mortal(newSViv(list16)));
- break;
- case RPM_INT32_TYPE:
- XPUSHs(sv_2mortal(newSViv((int_32 *) list)));
- break;
+ dSP;
+ if (header) {
+ int_32 *list = NULL;
+ uint_16 *list16;
+ int_32 count, type;
+ headerGetEntry(header, tag_name, &type, (void **) &list, &count);
+ if (list) {
+ if (count == 1 ) {
+ switch (type) {
+ case RPM_NULL_TYPE:
+ break;
+ case RPM_CHAR_TYPE:
+ XPUSHs(sv_2mortal(newSVpv((char *) list,strlen((char *) list))));
+ break;
+ case RPM_INT8_TYPE:
+ break;
+ case RPM_INT16_TYPE:
+ list16 = list;
+ XPUSHs(sv_2mortal(newSViv(list16)));
+ break;
+ case RPM_INT32_TYPE:
+ XPUSHs(sv_2mortal(newSViv((int_32 *) list)));
+ break;
/*
- case RPM_INT64_TYPE:
- break;
+ case RPM_INT64_TYPE:
+ break;
*/
- case RPM_STRING_TYPE:
- XPUSHs(sv_2mortal(newSVpv((char *) list, strlen((char *) list))));
-
- break;
- case RPM_BIN_TYPE:
- break;
- case RPM_STRING_ARRAY_TYPE:
- break;
- case RPM_I18NSTRING_TYPE:
- break;
- }
- } else {
- int i;
- for (i=0; i< count; i++) {
- switch (type) {
- case RPM_NULL_TYPE:
- break;
- case RPM_CHAR_TYPE:
- XPUSHs(sv_2mortal(newSVpv((char *) list,strlen((char *) list))));
- break;
- case RPM_INT8_TYPE:
- break;
- case RPM_INT16_TYPE:
- list16 = list;
- XPUSHs(sv_2mortal(newSViv(list16[i])));
- break;
- case RPM_INT32_TYPE:
- XPUSHs(sv_2mortal(newSViv((int_32 *) list[i])));
- break;
+ case RPM_STRING_TYPE:
+ XPUSHs(sv_2mortal(newSVpv((char *) list, strlen((char *) list))));
+ break;
+ case RPM_BIN_TYPE:
+ break;
+ case RPM_STRING_ARRAY_TYPE:
+ break;
+ case RPM_I18NSTRING_TYPE:
+ break;
+ }
+ } else {
+ int i;
+ for (i=0; i< count; i++) {
+ switch (type) {
+ case RPM_NULL_TYPE:
+ break;
+ case RPM_CHAR_TYPE:
+ XPUSHs(sv_2mortal(newSVpv((char *) list,strlen((char *) list))));
+ break;
+ case RPM_INT8_TYPE:
+ break;
+ case RPM_INT16_TYPE:
+ list16 = list;
+ XPUSHs(sv_2mortal(newSViv(list16[i])));
+ break;
+ case RPM_INT32_TYPE:
+ XPUSHs(sv_2mortal(newSViv((int_32 *) list[i])));
+ break;
/*
- case RPM_INT64_TYPE:
- break;
+ case RPM_INT64_TYPE:
+ break;
*/
- case RPM_STRING_TYPE:
- XPUSHs(sv_2mortal(newSVpv((char *) list[i], strlen((char *) list[i]))));
- break;
- case RPM_BIN_TYPE:
- break;
- case RPM_STRING_ARRAY_TYPE:
- XPUSHs(sv_2mortal(newSVpv((char *) list[i],strlen((char *) list[i]))));
- break;
- case RPM_I18NSTRING_TYPE:
- break;
- }
- }
- }
+ case RPM_STRING_TYPE:
+ XPUSHs(sv_2mortal(newSVpv((char *) list[i], strlen((char *) list[i]))));
+ break;
+ case RPM_BIN_TYPE:
+ break;
+ case RPM_STRING_ARRAY_TYPE:
+ XPUSHs(sv_2mortal(newSVpv((char *) list[i],strlen((char *) list[i]))));
+ break;
+ case RPM_I18NSTRING_TYPE:
+ break;
+ }
+ }
}
- }
- PUTBACK;
+ }
+ }
+ PUTBACK;
}