- add rpmGetRpmlibProvides() to retrieve rpmlib(...) provides
authorjbj <devnull@localhost>
Tue, 31 Oct 2000 16:53:14 +0000 (16:53 +0000)
committerjbj <devnull@localhost>
Tue, 31 Oct 2000 16:53:14 +0000 (16:53 +0000)
"Pawel A. Gajda" <mis@k2.net.pl>.

CVS patchset: 4236
CVS date: 2000/10/31 16:53:14

CHANGES
lib/rpmlib.h
lib/rpmlibprov.c

diff --git a/CHANGES b/CHANGES
index 02cd023..8fc53c3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -23,6 +23,8 @@
        - add brp-strip-shared script <rodrigob@conectiva.com.br>.
        - better item/task progress bars <rodrigob@conectiva.com.br>.
        - add support for SHA1 as well as MD5 message digests.
+       - add rpmGetRpmlibProvides() to retrieve rpmlib(...) provides
+               "Pawel A. Gajda" <mis@k2.net.pl>.
 
 3.0.6 -> 4.0
        - use DIRNAMES/BASENAMES/DIRINDICES not FILENAMES in packages and db.
index d1a2319..eaee33a 100644 (file)
@@ -905,6 +905,16 @@ typedef enum rpmtransFlags_e {
 } rpmtransFlags;
 
 /** \ingroup rpmtrans
+ * Return copy of rpmlib internal provides.
+ * @retval             address of array of rpmlib internal provide names
+ * @retval             address of array of rpmlib internal provide flags
+ * @retval             address of array of rpmlib internal provide versions
+ * @return             no. of entries
+ */
+int rpmGetRpmlibProvides(/*@out@*/ const char ***provNames,
+       /*@out@*/ int **provFlags, /*@out@*/ const char ***provVersions) /*@*/;
+
+/** \ingroup rpmtrans
  * Compare two versioned dependency ranges, looking for overlap.
  * @param AName                1st dependncy name string
  * @param AEVR         1st dependency [epoch:]version[-release] string
index 1da8cc3..e036df2 100644 (file)
@@ -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;
+}