2 * Copyright (c) 2011, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
9 * solver_private.h - private functions
13 #ifndef LIBSOLV_SOLVER_PRIVATE_H
14 #define LIBSOLV_SOLVER_PRIVATE_H
16 extern void solver_run_sat(Solver *solv, int disablerules, int doweak);
17 extern void solver_reset(Solver *solv);
19 extern int solver_splitprovides(Solver *solv, Id dep, Map *m);
20 extern int solver_dep_possible_slow(Solver *solv, Id dep, Map *m);
21 extern int solver_dep_fulfilled_cplx(Solver *solv, Reldep *rd);
22 extern int solver_is_supplementing_alreadyinstalled(Solver *solv, Solvable *s);
23 extern void solver_intersect_obsoleted(Solver *solv, Id p, Queue *q, int qstart, Map *m);
24 extern int solver_is_namespace_dep_slow(Solver *solv, Reldep *rd);
26 extern void solver_createcleandepsmap(Solver *solv, Map *cleandepsmap, int unneeded);
27 extern int solver_check_cleandeps_mistakes(Solver *solv);
30 #define ISSIMPLEDEP(pool, dep) (!ISRELDEP(dep) || GETRELDEP(pool, dep)->flags < 8)
33 solver_dep_possible(Solver *solv, Id dep, Map *m)
35 Pool *pool = solv->pool;
38 if (!ISSIMPLEDEP(pool, dep))
39 return solver_dep_possible_slow(solv, dep, m);
40 FOR_PROVIDES(p, pp, dep)
49 solver_dep_fulfilled(Solver *solv, Id dep)
51 Pool *pool = solv->pool;
56 Reldep *rd = GETRELDEP(pool, dep);
57 if (rd->flags == REL_COND || rd->flags == REL_UNLESS || rd->flags == REL_AND || rd->flags == REL_OR)
58 return solver_dep_fulfilled_cplx(solv, rd);
59 if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES)
60 return solver_splitprovides(solv, rd->evr, 0);
62 FOR_PROVIDES(p, pp, dep)
64 if (solv->decisionmap[p] > 0)
71 solver_is_supplementing(Solver *solv, Solvable *s)
76 supp = s->repo->idarraydata + s->supplements;
77 while ((sup = *supp++) != 0)
78 if (solver_dep_fulfilled(solv, sup))
84 solver_is_enhancing(Solver *solv, Solvable *s)
89 enhp = s->repo->idarraydata + s->enhances;
90 while ((enh = *enhp++) != 0)
91 if (solver_dep_fulfilled(solv, enh))
97 solver_is_namespace_dep(Solver *solv, Id dep)
99 Pool *pool = solv->pool;
103 rd = GETRELDEP(pool, dep);
104 if (rd->flags == REL_NAMESPACE)
106 if (ISRELDEP(rd->name))
107 return solver_is_namespace_dep_slow(solv, rd);
108 if (ISRELDEP(rd->evr))
109 return solver_is_namespace_dep_slow(solv, GETRELDEP(pool, rd->evr));
113 #endif /* LIBSOLV_SOLVER_PRIVATE_H */