Imported Upstream version 0.7.27
[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 s_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 #define SOLVER_SOLUTION_BLACK           (-5)
31 #define SOLVER_SOLUTION_STRICTREPOPRIORITY      (-6)
32 /* replace solution types */
33 #define SOLVER_SOLUTION_ERASE                   (-100)
34 #define SOLVER_SOLUTION_REPLACE                 (-101)
35 #define SOLVER_SOLUTION_REPLACE_DOWNGRADE       (-102)
36 #define SOLVER_SOLUTION_REPLACE_ARCHCHANGE      (-103)
37 #define SOLVER_SOLUTION_REPLACE_VENDORCHANGE    (-104)
38 #define SOLVER_SOLUTION_REPLACE_NAMECHANGE      (-105)
39
40 void solver_recordproblem(struct s_Solver *solv, Id rid);
41 void solver_fixproblem(struct s_Solver *solv, Id rid);
42 Id solver_autouninstall(struct s_Solver *solv, int start);
43 void solver_disableproblemset(struct s_Solver *solv, int start);
44
45 int solver_prepare_solutions(struct s_Solver *solv);
46
47 unsigned int solver_problem_count(struct s_Solver *solv);
48 Id solver_next_problem(struct s_Solver *solv, Id problem);
49 unsigned int solver_solution_count(struct s_Solver *solv, Id problem);
50 Id solver_next_solution(struct s_Solver *solv, Id problem, Id solution);
51 unsigned int solver_solutionelement_count(struct s_Solver *solv, Id problem, Id solution);
52 Id solver_solutionelement_internalid(struct s_Solver *solv, Id problem, Id solution);
53 Id solver_solutionelement_extrajobflags(struct s_Solver *solv, Id problem, Id solution);
54 Id solver_next_solutionelement(struct s_Solver *solv, Id problem, Id solution, Id element, Id *p, Id *rp);
55 void solver_all_solutionelements(struct s_Solver *solv, Id problem, Id solution, int expandreplaces, Queue *q);
56
57 void solver_take_solutionelement(struct s_Solver *solv, Id p, Id rp, Id extrajobflags, Queue *job);
58 void solver_take_solution(struct s_Solver *solv, Id problem, Id solution, Queue *job);
59
60 Id solver_findproblemrule(struct s_Solver *solv, Id problem);
61 void solver_findallproblemrules(struct s_Solver *solv, Id problem, Queue *rules);
62
63 extern const char *solver_problemruleinfo2str(struct s_Solver *solv, SolverRuleinfo type, Id source, Id target, Id dep);
64 extern const char *solver_problem2str(struct s_Solver *solv, Id problem);
65 extern const char *solver_solutionelement2str(struct s_Solver *solv, Id p, Id rp);
66 extern const char *solver_solutionelementtype2str(struct s_Solver *solv, int type, Id p, Id rp);
67
68 #ifdef __cplusplus
69 }
70 #endif
71
72 #endif