apply some patch for pythons rpm from opensource
[platform/upstream/rpm.git] / lib / rpmal.h
1 #ifndef H_RPMAL
2 #define H_RPMAL
3
4 /** \ingroup rpmdep rpmtrans
5  * \file lib/rpmal.h
6  * Structures used for managing added/available package lists.
7  */
8
9 #include <rpm/rpmtypes.h>
10 #include <rpm/rpmts.h>
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 typedef struct rpmal_s * rpmal;
17
18 /**
19  * Initialize available packckages, items, and directory list.
20  * @param pool          shared string pool with base, dir and dependency names
21  * @param delta         no. of entries to add on each realloc
22  * @param tsflags       transaction control flags
23  * @param tscolor       transaction color bits
24  * @param prefcolor     preferred color
25  * @return al           new available list
26  */
27 RPM_GNUC_INTERNAL
28 rpmal rpmalCreate(rpmstrPool pool, int delta, rpmtransFlags tsflags,
29                   rpm_color_t tscolor, rpm_color_t prefcolor);
30
31 /**
32  * Free available packages, items, and directory members.
33  * @param al            available list
34  * @return              NULL always
35  */
36 RPM_GNUC_INTERNAL
37 rpmal rpmalFree(rpmal al);
38
39 /**
40  * Delete package from available list.
41  * @param al            available list
42  * @param p             package
43  */
44 RPM_GNUC_INTERNAL
45 void rpmalDel(rpmal al, rpmte p);
46
47 /**
48  * Add package to available list.
49  * @param al            available list
50  * @param p             package
51  */
52 RPM_GNUC_INTERNAL
53 void rpmalAdd(rpmal al, rpmte p);
54
55 /**
56  * Lookup all obsoleters for a dependency in the available list
57  * @param al            available list
58  * @param ds            dependency set
59  * @return              obsoleting packages for ds, NULL if none
60  */
61 RPM_GNUC_INTERNAL
62 rpmte * rpmalAllObsoletes(const rpmal al, const rpmds ds);
63
64 /**
65  * Lookup all providers for a dependency in the available list
66  * @param al            available list
67  * @param ds            dependency set
68  * @return              best provider for the dependency, NULL if none
69  */
70 RPM_GNUC_INTERNAL
71 rpmte * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds);
72
73 /**
74  * Lookup best provider for a dependency in the available list
75  * @param al            available list
76  * @param te            transaction element
77  * @param ds            dependency set
78  * @return              best provider for the dependency, NULL if none
79  */
80 RPM_GNUC_INTERNAL
81 rpmte rpmalSatisfiesDepend(const rpmal al, const rpmte te, const rpmds ds);
82
83 /**
84  * Return index of a transaction element  in the available list
85  * @param al           available list
86  * @param te           transaction element
87  * @return             index, (unsigned int)-1 if not found
88  */
89 RPM_GNUC_INTERNAL
90 unsigned int rpmalLookupTE(const rpmal al, const rpmte te);
91
92 #ifdef __cplusplus
93 }
94 #endif
95
96 #endif  /* H_RPMAL */