X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fpolicy.h;h=68f4db93d1f3091c2e6b5add446f8eacfa2615d3;hb=e679b515eddb3dd340fb25620de0160211f40fdc;hp=9e4de9483c555b54770b5871bab4c95e50cbe9d7;hpb=f8954306ed9879bf3efafab91c099876614245d7;p=platform%2Fupstream%2Flibsolv.git diff --git a/src/policy.h b/src/policy.h index 9e4de94..68f4db9 100644 --- a/src/policy.h +++ b/src/policy.h @@ -12,57 +12,39 @@ #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_MODE_CHOOSE_NOREORDER 3 /* internal, do not use */ +#define POLICY_MODE_SUPPLEMENT 4 /* internal, do not use */ -/* This functions can be used for sorting solvables to a specific order like architecture, version. */ -/* Solvables which does not fit to the system will be deleted from the list. */ -extern void prune_best_arch_name_version(Solver *solv, Pool *pool, Queue *plist); - -extern void prune_to_best_arch(Pool *pool, Queue *plist); -extern void prune_to_best_version(Pool *pool, Queue *plist); +#define POLICY_ILLEGAL_DOWNGRADE 1 +#define POLICY_ILLEGAL_ARCHCHANGE 2 +#define POLICY_ILLEGAL_VENDORCHANGE 4 +#define POLICY_ILLEGAL_NAMECHANGE 8 -/* The following default policies can be overloaded by the application by using callbacks which are - * descibed in solver.h: - * - * Finding best candidate - * - * Callback definition: - * void bestSolvable (Pool *pool, Queue *canditates) - * candidates : List of canditates which has to be sorted by the function call - * return candidates: Sorted list of the candidates(first is the best). - * - * Checking if two solvables has compatible architectures - * - * Callback definition: - * int archCheck (Pool *pool, Solvable *solvable1, Solvable *solvable2); - * - * return 0 it the two solvables has compatible architectures - * - * Checking if two solvables has compatible vendors - * - * Callback definition: - * int vendorCheck (Pool *pool, Solvable *solvable1, Solvable *solvable2); - * - * return 0 it the two solvables has compatible architectures - * - * Evaluate update candidate - * - * Callback definition: - * void pdateCandidateCb (Pool *pool, Solvable *solvable, Queue *canditates) - * solvable : for which updates should be search - * candidates : List of candidates (This list depends on other - * restrictions like architecture and vendor policies too) - */ 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 void policy_findupdatepackages(Solver *solv, - Solvable *s, - Queue *qs, - int allowall); /* do not regard policies for vendor,architecuture,... change */ +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_update_recommendsmap(Solver *solv); extern void policy_create_obsolete_index(Solver *solv); +extern void pool_best_solvables(Pool *pool, Queue *plist, int flags); + +/* internal, do not use */ +extern void prune_to_best_version(Pool *pool, Queue *plist); +extern void policy_prefer_favored(Solver *solv, Queue *plist); + + +#ifdef __cplusplus +} +#endif