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_dep_installed(Solver *solv, Id dep);
20 extern int solver_splitprovides(Solver *solv, Id dep);
23 solver_dep_fulfilled(Solver *solv, Id dep)
25 Pool *pool = solv->pool;
30 Reldep *rd = GETRELDEP(pool, dep);
31 if (rd->flags == REL_AND || rd->flags == REL_COND)
33 if (!solver_dep_fulfilled(solv, rd->name))
35 return solver_dep_fulfilled(solv, rd->evr);
37 if (rd->flags == REL_OR)
39 if (solver_dep_fulfilled(solv, rd->name))
41 return solver_dep_fulfilled(solv, rd->evr);
43 if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES)
44 return solver_splitprovides(solv, rd->evr);
45 if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED)
46 return solver_dep_installed(solv, rd->evr);
48 FOR_PROVIDES(p, pp, dep)
50 if (solv->decisionmap[p] > 0)
57 solver_is_supplementing(Solver *solv, Solvable *s)
62 supp = s->repo->idarraydata + s->supplements;
63 while ((sup = *supp++) != 0)
64 if (solver_dep_fulfilled(solv, sup))
70 solver_is_enhancing(Solver *solv, Solvable *s)
75 enhp = s->repo->idarraydata + s->enhances;
76 while ((enh = *enhp++) != 0)
77 if (solver_dep_fulfilled(solv, enh))
82 #endif /* LIBSOLV_SOLVER_PRIVATE_H */