summaryrefslogtreecommitdiff
path: root/src/policy.h
blob: c3ddb3255ac500a1300cbf7998a194dde62c519b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * Copyright (c) 2007, Novell Inc.
 *
 * This program is licensed under the BSD license, read LICENSE.BSD
 * for further information
 */

/*
 * Generic policy interface for SAT solver
 * The policy* function can be "overloaded" by defining a callback in the solver struct.
 */

#include "solver.h"

#ifdef __cplusplus
extern "C" {
#endif

#define POLICY_MODE_CHOOSE	0
#define POLICY_MODE_RECOMMEND	1
#define POLICY_MODE_SUGGEST	2


#define POLICY_ILLEGAL_DOWNGRADE	1
#define POLICY_ILLEGAL_ARCHCHANGE	2
#define POLICY_ILLEGAL_VENDORCHANGE	4
#define POLICY_ILLEGAL_NAMECHANGE	8

extern void policy_filter_unwanted(Solver *solv, Queue *plist, int mode);
extern int  policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2);
extern int  policy_illegal_vendorchange(Solver *solv, Solvable *s1, Solvable *s2);
extern int  policy_is_illegal(Solver *solv, Solvable *s1, Solvable *s2, int ignore);
extern void policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allowall);
extern const char *policy_illegal2str(Solver *solv, int illegal, Solvable *s, Solvable *rs);

extern void policy_create_obsolete_index(Solver *solv);


#ifdef __cplusplus
}
#endif