c3ddb3255ac500a1300cbf7998a194dde62c519b
[platform/upstream/libsolv.git] / src / policy.h
1 /*
2  * Copyright (c) 2007, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7
8 /*
9  * Generic policy interface for SAT solver
10  * The policy* function can be "overloaded" by defining a callback in the solver struct.
11  */
12
13 #include "solver.h"
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 #define POLICY_MODE_CHOOSE      0
20 #define POLICY_MODE_RECOMMEND   1
21 #define POLICY_MODE_SUGGEST     2
22
23
24 #define POLICY_ILLEGAL_DOWNGRADE        1
25 #define POLICY_ILLEGAL_ARCHCHANGE       2
26 #define POLICY_ILLEGAL_VENDORCHANGE     4
27 #define POLICY_ILLEGAL_NAMECHANGE       8
28
29 extern void policy_filter_unwanted(Solver *solv, Queue *plist, int mode);
30 extern int  policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2);
31 extern int  policy_illegal_vendorchange(Solver *solv, Solvable *s1, Solvable *s2);
32 extern int  policy_is_illegal(Solver *solv, Solvable *s1, Solvable *s2, int ignore);
33 extern void policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allowall);
34 extern const char *policy_illegal2str(Solver *solv, int illegal, Solvable *s, Solvable *rs);
35
36 extern void policy_create_obsolete_index(Solver *solv);
37
38
39 #ifdef __cplusplus
40 }
41 #endif