63319d6cbf09c686e2e7f03e0e9adaea184620bf
[platform/upstream/libsolv.git] / src / problems.h
1 /*
2  * Copyright (c) 2007-2009, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7
8 /*
9  * problems.h
10  *
11  */
12
13 #ifndef LIBSOLV_PROBLEMS_H
14 #define LIBSOLV_PROBLEMS_H
15
16 #include "rules.h"
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22
23 struct _Solver;
24
25 #define SOLVER_SOLUTION_JOB             (0)
26 #define SOLVER_SOLUTION_DISTUPGRADE     (-1)
27 #define SOLVER_SOLUTION_INFARCH         (-2)
28 #define SOLVER_SOLUTION_BEST            (-3)
29 #define SOLVER_SOLUTION_POOLJOB         (-4)
30
31 void solver_recordproblem(struct _Solver *solv, Id rid);
32 void solver_fixproblem(struct _Solver *solv, Id rid);
33 Id solver_autouninstall(struct _Solver *solv, int start);
34 void solver_disableproblemset(struct _Solver *solv, int start);
35
36 int solver_prepare_solutions(struct _Solver *solv);
37
38 unsigned int solver_problem_count(struct _Solver *solv);
39 Id solver_next_problem(struct _Solver *solv, Id problem);
40 unsigned int solver_solution_count(struct _Solver *solv, Id problem);
41 Id solver_next_solution(struct _Solver *solv, Id problem, Id solution);
42 unsigned int solver_solutionelement_count(struct _Solver *solv, Id problem, Id solution);
43 Id solver_solutionelement_internalid(struct _Solver *solv, Id problem, Id solution);
44 Id solver_solutionelement_extrajobflags(struct _Solver *solv, Id problem, Id solution);
45 Id solver_next_solutionelement(struct _Solver *solv, Id problem, Id solution, Id element, Id *p, Id *rp);
46
47 void solver_take_solutionelement(struct _Solver *solv, Id p, Id rp, Id extrajobflags, Queue *job);
48 void solver_take_solution(struct _Solver *solv, Id problem, Id solution, Queue *job);
49
50 Id solver_findproblemrule(struct _Solver *solv, Id problem);
51 void solver_findallproblemrules(struct _Solver *solv, Id problem, Queue *rules);
52
53 extern const char *solver_problemruleinfo2str(struct _Solver *solv, SolverRuleinfo type, Id source, Id target, Id dep);
54 extern const char *solver_problem2str(struct _Solver *solv, Id problem);
55 extern const char *solver_solutionelement2str(struct _Solver *solv, Id p, Id rp);
56
57 #ifdef __cplusplus
58 }
59 #endif
60
61 #endif