]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Add repodata_lookup_dirstrarray_uninternalized()
authorMichael Schroeder <mls@suse.de>
Wed, 18 Nov 2015 14:25:10 +0000 (15:25 +0100)
committerMichael Schroeder <mls@suse.de>
Wed, 18 Nov 2015 14:25:10 +0000 (15:25 +0100)
Search the filelist of not yet internalized solvables.
Needed for the following commits.

src/libsolv.ver
src/repodata.c
src/repodata.h

index 5d372aab80597ca2e0827c862daebae6a14ff80d..65082881c5b35c678e4d1825643cf982dc535bef 100644 (file)
@@ -202,6 +202,7 @@ SOLV_1.0 {
                repodata_localize_id;
                repodata_lookup_bin_checksum;
                repodata_lookup_binary;
+               repodata_lookup_dirstrarray_uninternalized;
                repodata_lookup_id;
                repodata_lookup_id_uninternalized;
                repodata_lookup_idarray;
index c85426299ee3e358b72cfc8ce9efe745d547e74c..15e9706c98459eccb28b7498574b5ad6bc000eaa 100644 (file)
@@ -849,6 +849,37 @@ repodata_lookup_id_uninternalized(Repodata *data, Id solvid, Id keyname, Id void
   return 0;
 }
 
+const char *
+repodata_lookup_dirstrarray_uninternalized(Repodata *data, Id solvid, Id keyname, Id *didp, Id *iterp)
+{
+  Id *ap, did;
+  Id iter = *iterp;
+  if (iter == 0)       /* find key data */
+    {
+      if (!data->attrs)
+       return 0;
+      ap = data->attrs[solvid - data->start];
+      if (!ap)
+       return 0;
+      for (; *ap; ap += 2)
+       if (data->keys[*ap].name == keyname && data->keys[*ap].type == REPOKEY_TYPE_DIRSTRARRAY)
+         break;
+      if (!*ap)
+       return 0;
+      iter = ap[1];
+    }
+  did = *didp;
+  for (ap = data->attriddata + iter; *ap; ap += 2)
+    {
+      if (did && ap[0] != did)
+       continue;
+      *didp = ap[0];
+      *iterp = ap - data->attriddata + 2;
+      return (const char *)data->attrdata + ap[1];
+    }
+  *iterp = 0;
+  return 0;
+}
 
 /************************************************************************
  * data search
index ad05525c61fb283834cef29579fc92f35a67bdca..c18c688fda4e7eff590b5d4e3029e63469871218 100644 (file)
@@ -301,6 +301,7 @@ void repodata_set_location(Repodata *data, Id solvid, int medianr, const char *d
 void repodata_set_deltalocation(Repodata *data, Id handle, int medianr, const char *dir, const char *file);
 void repodata_set_sourcepkg(Repodata *data, Id solvid, const char *sourcepkg);
 Id repodata_lookup_id_uninternalized(Repodata *data, Id solvid, Id keyname, Id voidid);
+const char *repodata_lookup_dirstrarray_uninternalized(Repodata *data, Id solvid, Id keyname, Id *didp, Id *iterp);
 
 /* stats */
 unsigned int repodata_memused(Repodata *data);