+extern Id pool_addrelproviders(Pool *pool, Id d);
+
+static inline Id pool_whatprovides(Pool *pool, Id d)
+{
+ Id v;
+ if (!ISRELDEP(d))
+ return pool->whatprovides[d];
+ v = GETRELID(d);
+ if (pool->whatprovides_rel[v])
+ return pool->whatprovides_rel[v];
+ return pool_addrelproviders(pool, d);
+}
+
+static inline Id *pool_whatprovides_ptr(Pool *pool, Id d)
+{
+ Id off = pool_whatprovides(pool, d);
+ return pool->whatprovidesdata + off;
+}
+
+extern void pool_setdebuglevel(Pool *pool, int level);
+
+static inline void pool_setdebugcallback(Pool *pool, void (*debugcallback)(struct _Pool *, void *data, int type, const char *str), void *debugcallbackdata)
+{
+ pool->debugcallback = debugcallback;
+ pool->debugcallbackdata = debugcallbackdata;
+}
+
+static inline void pool_setdebugmask(Pool *pool, int mask)
+{
+ pool->debugmask = mask;
+}
+
+static inline void pool_setloadcallback(Pool *pool, FILE *(*cb)(struct _Pool *, struct _Repodata *, void *), void *loadcbdata)
+{
+ pool->loadcallback = cb;
+ pool->loadcallbackdata = loadcbdata;
+}
+
+/* search the pool. the following filters are available:
+ * p - search just this solvable
+ * key - search only this key
+ * match - key must match this string
+ */
+void pool_search(Pool *pool, Id p, Id key, const char *match, int flags, int (*callback)(void *cbdata, Solvable *s, struct _Repodata *data, struct _Repokey *key, struct _KeyValue *kv), void *cbdata);
+
+void pool_clear_pos(Pool *pool);
+
+
+typedef struct _duchanges {
+ const char *path;
+ int kbytes;
+ int files;
+} DUChanges;
+
+void pool_calc_duchanges(Pool *pool, Map *installedmap, DUChanges *mps, int nmps);
+int pool_calc_installsizechange(Pool *pool, Map *installedmap);
+void pool_trivial_installable(Pool *pool, Map *installedmap, Queue *pkgs, Queue *res);
+void pool_trivial_installable_noobsoletesmap(Pool *pool, Map *installedmap, Queue *pkgs, Queue *res, Map *noobsoletesmap);
+
+const char *pool_lookup_str(Pool *pool, Id entry, Id keyname);
+Id pool_lookup_id(Pool *pool, Id entry, Id keyname);
+unsigned int pool_lookup_num(Pool *pool, Id entry, Id keyname, unsigned int notfound);
+int pool_lookup_void(Pool *pool, Id entry, Id keyname);
+const unsigned char *pool_lookup_bin_checksum(Pool *pool, Id entry, Id keyname, Id *typep);
+const char *pool_lookup_checksum(Pool *pool, Id entry, Id keyname, Id *typep);
+
+void pool_add_fileconflicts_deps(Pool *pool, Queue *conflicts);
+
+
+
+/* loop over all providers of d */
+#define FOR_PROVIDES(v, vp, d) \
+ for (vp = pool_whatprovides(pool, d) ; (v = pool->whatprovidesdata[vp++]) != 0; )
+
+/* loop over all repositories */
+/* note that idx is not the repoid */
+#define FOR_REPOS(idx, r) \
+ for (idx = 0; idx < pool->nrepos; idx++) \
+ if ((r = pool->repos[idx]) != 0)
+
+
+#define POOL_DEBUG(type, ...) do {if ((pool->debugmask & (type)) != 0) pool_debug(pool, (type), __VA_ARGS__);} while (0)
+#define IF_POOLDEBUG(type) if ((pool->debugmask & (type)) != 0)
+