diff options
author | jbj <devnull@localhost> | 2000-10-31 16:53:14 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2000-10-31 16:53:14 +0000 |
commit | 865ba80f1eebe26aa8e81634d643d6ec95faf5fa (patch) | |
tree | a01321adde67617e7fc04690a752579f13ab184f /lib/rpmlibprov.c | |
parent | edfbc6958ac14d095801ced4abf585aa74b2ad67 (diff) | |
download | librpm-tizen-865ba80f1eebe26aa8e81634d643d6ec95faf5fa.tar.gz librpm-tizen-865ba80f1eebe26aa8e81634d643d6ec95faf5fa.tar.bz2 librpm-tizen-865ba80f1eebe26aa8e81634d643d6ec95faf5fa.zip |
- add rpmGetRpmlibProvides() to retrieve rpmlib(...) provides
"Pawel A. Gajda" <mis@k2.net.pl>.
CVS patchset: 4236
CVS date: 2000/10/31 16:53:14
Diffstat (limited to 'lib/rpmlibprov.c')
-rw-r--r-- | lib/rpmlibprov.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/rpmlibprov.c b/lib/rpmlibprov.c index 1da8cc3d1..e036df2b2 100644 --- a/lib/rpmlibprov.c +++ b/lib/rpmlibprov.c @@ -52,3 +52,34 @@ int rpmCheckRpmlibProvides(const char * keyName, const char * keyEVR, } return rc; } + +int rpmGetRpmlibProvides(const char ***provNames, int **provFlags, + const char ***provVersions) +{ + char **names, **versions; + int *flags; + int n = 0; + + while (rpmlibProvides[n++].featureName != NULL) + ; + + names = xmalloc(sizeof(*names) * n); + versions = xmalloc(sizeof(*versions) * n); + flags = xmalloc(sizeof(*flags) * n); + + n = 0; + while (rpmlibProvides[n].featureName != NULL) { + names[n] = rpmlibProvides[n].featureName; + flags[n] = rpmlibProvides[n].featureFlags; + versions[n] = rpmlibProvides[n].featureEVR; + n++; + } + + names[n] = NULL; + versions[n] = NULL; + + *provNames = names; + *provFlags = flags; + *provVersions = versions; + return n; +} |