selection.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (c) 2012, Novell Inc.
  3. *
  4. * This program is licensed under the BSD license, read LICENSE.BSD
  5. * for further information
  6. */
  7. /*
  8. * selection.h
  9. *
  10. */
  11. #ifndef LIBSOLV_SELECTION_H
  12. #define LIBSOLV_SELECTION_H
  13. #include "pool.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* what to match */
  18. #define SELECTION_NAME (1 << 0)
  19. #define SELECTION_PROVIDES (1 << 1)
  20. #define SELECTION_FILELIST (1 << 2)
  21. #define SELECTION_CANON (1 << 3)
  22. /* match extensions */
  23. #define SELECTION_DOTARCH (1 << 4) /* allow ".arch" suffix */
  24. #define SELECTION_REL (1 << 5) /* allow "<=> rel" suffix */
  25. /* string comparison modifiers */
  26. #define SELECTION_GLOB (1 << 9)
  27. #define SELECTION_NOCASE (1 << 11)
  28. /* extra flags */
  29. #define SELECTION_FLAT (1 << 10) /* flatten the resulting selection */
  30. #define SELECTION_SKIP_KIND (1 << 14) /* remove kind: name prefix in SELECTION_NAME matches */
  31. #define SELECTION_MATCH_DEPSTR (1 << 15) /* match dep2str result */
  32. /* package selection */
  33. #define SELECTION_INSTALLED_ONLY (1 << 8)
  34. #define SELECTION_SOURCE_ONLY (1 << 12)
  35. #define SELECTION_WITH_SOURCE (1 << 13)
  36. #define SELECTION_WITH_DISABLED (1 << 16)
  37. #define SELECTION_WITH_BADARCH (1 << 17)
  38. #define SELECTION_WITH_ALL (SELECTION_WITH_SOURCE | SELECTION_WITH_DISABLED | SELECTION_WITH_BADARCH)
  39. /* result operator */
  40. #define SELECTION_REPLACE (0 << 28)
  41. #define SELECTION_ADD (1 << 28)
  42. #define SELECTION_SUBTRACT (2 << 28)
  43. #define SELECTION_FILTER (3 << 28)
  44. /* extra SELECTION_FILTER bits */
  45. #define SELECTION_FILTER_KEEP_IFEMPTY (1 << 30)
  46. #define SELECTION_FILTER_SWAPPED (1 << 31)
  47. /* internal */
  48. #define SELECTION_MODEBITS (3 << 28)
  49. extern int selection_make(Pool *pool, Queue *selection, const char *name, int flags);
  50. extern int selection_make_matchdeps(Pool *pool, Queue *selection, const char *name, int flags, int keyname, int marker);
  51. extern int selection_make_matchdepid(Pool *pool, Queue *selection, Id dep, int flags, int keyname, int marker);
  52. extern int selection_make_matchsolvable(Pool *pool, Queue *selection, Id solvid, int flags, int keyname, int marker);
  53. extern int selection_make_matchsolvablelist(Pool *pool, Queue *selection, Queue *solvidq, int flags, int keyname, int marker);
  54. extern void selection_filter(Pool *pool, Queue *sel1, Queue *sel2);
  55. extern void selection_add(Pool *pool, Queue *sel1, Queue *sel2);
  56. extern void selection_subtract(Pool *pool, Queue *sel1, Queue *sel2);
  57. extern void selection_solvables(Pool *pool, Queue *selection, Queue *pkgs);
  58. extern const char *pool_selection2str(Pool *pool, Queue *selection, Id flagmask);
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif