2 * Copyright (c) 2012, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
13 #ifndef LIBSOLV_SELECTION_H
14 #define LIBSOLV_SELECTION_H
23 #define SELECTION_NAME (1 << 0)
24 #define SELECTION_PROVIDES (1 << 1)
25 #define SELECTION_FILELIST (1 << 2)
26 #define SELECTION_CANON (1 << 3)
28 /* match extensions */
29 #define SELECTION_DOTARCH (1 << 4) /* allow ".arch" suffix */
30 #define SELECTION_REL (1 << 5) /* allow "<=> rel" suffix */
32 /* string comparison modifiers */
33 #define SELECTION_GLOB (1 << 9)
34 #define SELECTION_NOCASE (1 << 11)
37 #define SELECTION_FLAT (1 << 10) /* flatten the resulting selection */
38 #define SELECTION_SKIP_KIND (1 << 14) /* remove kind: name prefix in SELECTION_NAME matches */
39 #define SELECTION_MATCH_DEPSTR (1 << 15) /* match dep2str result */
41 /* package selection */
42 #define SELECTION_INSTALLED_ONLY (1 << 8)
43 #define SELECTION_SOURCE_ONLY (1 << 12)
44 #define SELECTION_WITH_SOURCE (1 << 13)
45 #define SELECTION_WITH_DISABLED (1 << 16)
46 #define SELECTION_WITH_BADARCH (1 << 17)
47 #define SELECTION_WITH_ALL (SELECTION_WITH_SOURCE | SELECTION_WITH_DISABLED | SELECTION_WITH_BADARCH)
50 #define SELECTION_REPLACE (0 << 28)
51 #define SELECTION_ADD (1 << 28)
52 #define SELECTION_SUBTRACT (2 << 28)
53 #define SELECTION_FILTER (3 << 28)
55 #define SELECTION_MODEBITS (3 << 28) /* internal */
57 /* extra SELECTION_FILTER bits */
58 #define SELECTION_FILTER_KEEP_IFEMPTY (1 << 30)
59 #define SELECTION_FILTER_SWAPPED (1 << 31)
62 extern int selection_make(Pool *pool, Queue *selection, const char *name, int flags);
63 extern int selection_make_matchdeps(Pool *pool, Queue *selection, const char *name, int flags, int keyname, int marker);
64 extern int selection_make_matchdepid(Pool *pool, Queue *selection, Id dep, int flags, int keyname, int marker);
66 extern void selection_filter(Pool *pool, Queue *sel1, Queue *sel2);
67 extern void selection_add(Pool *pool, Queue *sel1, Queue *sel2);
68 extern void selection_subtract(Pool *pool, Queue *sel1, Queue *sel2);
70 extern void selection_solvables(Pool *pool, Queue *selection, Queue *pkgs);
72 extern const char *pool_selection2str(Pool *pool, Queue *selection, Id flagmask);