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);
22 solver_dep_fulfilled(Solver *solv, Id dep)
24 Pool *pool = solv->pool;
29 Reldep *rd = GETRELDEP(pool, dep);
30 if (rd->flags == REL_COND)
32 if (ISRELDEP(rd->evr))
34 Reldep *rd2 = GETRELDEP(pool, rd->evr);
35 if (rd2->flags == REL_ELSE)
37 if (solver_dep_fulfilled(solv, rd2->name))
38 return solver_dep_fulfilled(solv, rd->name);
39 return solver_dep_fulfilled(solv, rd2->evr);
42 if (solver_dep_fulfilled(solv, rd->name))
44 return !solver_dep_fulfilled(solv, rd->evr);
46 if (rd->flags == REL_AND)
48 if (!solver_dep_fulfilled(solv, rd->name))
50 return solver_dep_fulfilled(solv, rd->evr);
52 if (rd->flags == REL_OR)
54 if (solver_dep_fulfilled(solv, rd->name))
56 return solver_dep_fulfilled(solv, rd->evr);
58 if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES)
59 return solver_splitprovides(solv, rd->evr, 0);
61 FOR_PROVIDES(p, pp, dep)
63 if (solv->decisionmap[p] > 0)
70 solver_is_supplementing(Solver *solv, Solvable *s)
75 supp = s->repo->idarraydata + s->supplements;
76 while ((sup = *supp++) != 0)
77 if (solver_dep_fulfilled(solv, sup))
83 solver_is_enhancing(Solver *solv, Solvable *s)
88 enhp = s->repo->idarraydata + s->enhances;
89 while ((enh = *enhp++) != 0)
90 if (solver_dep_fulfilled(solv, enh))
95 #endif /* LIBSOLV_SOLVER_PRIVATE_H */