]> git.ipfire.org Git - thirdparty/libsolv.git/blob - src/policy.h
Also set errno for unsupported compressions in solv_xfopen_fd()
[thirdparty/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 #define POLICY_MODE_CHOOSE_NOREORDER 3 /* internal, do not use */
23 #define POLICY_MODE_SUPPLEMENT 4 /* internal, do not use */
24 #define POLICY_MODE_FAVOR_REC (1 << 30) /* internal, do not use */
25
26
27 #define POLICY_ILLEGAL_DOWNGRADE 1
28 #define POLICY_ILLEGAL_ARCHCHANGE 2
29 #define POLICY_ILLEGAL_VENDORCHANGE 4
30 #define POLICY_ILLEGAL_NAMECHANGE 8
31
32 extern void policy_filter_unwanted(Solver *solv, Queue *plist, int mode);
33 extern int policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2);
34 extern int policy_illegal_vendorchange(Solver *solv, Solvable *s1, Solvable *s2);
35 extern int policy_is_illegal(Solver *solv, Solvable *s1, Solvable *s2, int ignore);
36 extern void policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allowall);
37 extern const char *policy_illegal2str(Solver *solv, int illegal, Solvable *s, Solvable *rs);
38 extern void policy_update_recommendsmap(Solver *solv);
39
40 extern void policy_create_obsolete_index(Solver *solv);
41
42 extern void pool_best_solvables(Pool *pool, Queue *plist, int flags);
43
44 /* internal, do not use */
45 extern void prune_to_best_version(Pool *pool, Queue *plist);
46 extern void policy_prefer_favored(Solver *solv, Queue *plist);
47
48
49 #ifdef __cplusplus
50 }
51 #endif