summaryrefslogtreecommitdiff
path: root/lib/formats.c
diff options
context:
space:
mode:
authorewt <devnull@localhost>1997-05-30 14:16:20 +0000
committerewt <devnull@localhost>1997-05-30 14:16:20 +0000
commit9491610f7edd4338a1b186c50000b1ea1b6d1801 (patch)
tree70b28137c6341f5158202c377e642312342bcb4a /lib/formats.c
parent93af6a49c303b2b1eed3957e6eb70d2a9215dd7c (diff)
downloadrpm-9491610f7edd4338a1b186c50000b1ea1b6d1801.tar.gz
rpm-9491610f7edd4338a1b186c50000b1ea1b6d1801.tar.bz2
rpm-9491610f7edd4338a1b186c50000b1ea1b6d1801.zip
added virtual query tag ability, fsnames query tag,
CVS patchset: 1668 CVS date: 1997/05/30 14:16:20
Diffstat (limited to 'lib/formats.c')
-rw-r--r--lib/formats.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/formats.c b/lib/formats.c
index 2e0f10146..a4d4e89b5 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -13,9 +13,12 @@ static char * depflagsFormat(int_32 type, const void * data,
char * formatPrefix, int padding, int element);
static char * fflagsFormat(int_32 type, const void * data,
char * formatPrefix, int padding, int element);
+static int fsnamesTag(Header h, int_32 * type, void ** data, int_32 * count,
+ int * freeData);
static char * permsString(int mode);
const struct headerSprintfExtension rpmHeaderFormats[] = {
+ { HEADER_EXT_TAG, "RPMTAG_FSNAMES", { fsnamesTag } },
{ HEADER_EXT_FORMAT, "depflags", { depflagsFormat } },
{ HEADER_EXT_FORMAT, "fflags", { fflagsFormat } },
{ HEADER_EXT_FORMAT, "perms", { permsFormat } },
@@ -145,3 +148,23 @@ static char * depflagsFormat(int_32 type, const void * data,
return val;
}
+
+static int fsnamesTag(Header h, int_32 * type, void ** data, int_32 * count,
+ int * freeData) {
+ char ** list;
+ int i;
+
+ if (rpmGetFilesystemList(&list)) {
+ return 1;
+ }
+
+ *type = RPM_STRING_ARRAY_TYPE;
+ *((char ***) data) = list;
+
+ for (i = 0; list[i]; i++) ;
+ *count = i;
+
+ *freeData = 0;
+
+ return 0;
+}