Skip to content
Newer
Older
100644 357 lines (271 sloc) 11.2 KB
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
1 /*
1312779 @mlschroe - add a license
mlschroe authored Nov 8, 2007
2 * Copyright (c) 2007, Novell Inc.
3 *
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
6 */
7
8 /*
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
9 * pool.h
10 *
11 */
12
4cd5d62 @mlschroe rename satsolver -> libsolv
mlschroe authored May 24, 2011
13 #ifndef LIBSOLV_POOL_H
14 #define LIBSOLV_POOL_H
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
15
0fb02a1 @susematz Make the satsolver header usable with C++ (only pool.h and source_solv.h
susematz authored Oct 12, 2007
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
6fafd50 @dmacvicar compile
dmacvicar authored Feb 10, 2008
20 #include <stdio.h>
21
09f29f7 @mlschroe - rename all sat_ to solv_
mlschroe authored Jul 12, 2011
22 #include "solvversion.h"
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
23 #include "pooltypes.h"
24 #include "poolid.h"
25 #include "solvable.h"
f93fa50 @susematz Introduce pool->considered. A map to select a subset of solvables for
susematz authored Feb 12, 2008
26 #include "bitmap.h"
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
27 #include "queue.h"
9e09e79 @susematz Reduce C&P code by factoring out the uniquifying string pool.
susematz authored Nov 16, 2007
28 #include "strpool.h"
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
29
30 /* well known ids */
fc71135 @mlschroe - move known id definitions to one file, lets see if g++ likes it
mlschroe authored Mar 18, 2008
31 #include "knownid.h"
90d3a66 @mlschroe - add support for namespace callbacks
mlschroe authored Oct 25, 2007
32
33 /* well known solvable */
34 #define SYSTEMSOLVABLE 1
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
35
8340c83 @mlschroe - move dep2str buffer into pool so that the memory gets released
mlschroe authored Oct 26, 2007
36
37 /* how many strings to maintain (round robin) */
b53291b @mlschroe - clean up tmp space management
mlschroe authored Mar 4, 2008
38 #define POOL_TMPSPACEBUF 16
8340c83 @mlschroe - move dep2str buffer into pool so that the memory gets released
mlschroe authored Oct 26, 2007
39
34fd443 @mlschroe - set pool_id2color, fix comments
mlschroe authored Jan 11, 2012
40 /*----------------------------------------------- */
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
41
cdd0e99 @mlschroe - changed repo interface a bit, now alloc/free handle repo pointer and
mlschroe authored Nov 17, 2007
42 struct _Repo;
dc242b8 @susematz Support for generating separate sub files and bugfixes in the reader
susematz authored Feb 10, 2008
43 struct _Repodata;
d26640b @mlschroe - add pool_search() function to search the pool
mlschroe authored Feb 15, 2008
44 struct _Repokey;
45 struct _KeyValue;
cdd0e99 @mlschroe - changed repo interface a bit, now alloc/free handle repo pointer and
mlschroe authored Nov 17, 2007
46
18579bb @mlschroe - delete fixed vendor classes, add pool_setvendorclasses() method
mlschroe authored Mar 23, 2011
47 typedef struct _Datapos {
4e94138 @mlschroe - move search position into pool
mlschroe authored Oct 9, 2008
48 struct _Repo *repo;
f8393a7 @mlschroe - more cleanups:
mlschroe authored Oct 20, 2008
49 Id solvid;
4e94138 @mlschroe - move search position into pool
mlschroe authored Oct 9, 2008
50 Id repodataid;
51 Id schema;
52 Id dp;
18579bb @mlschroe - delete fixed vendor classes, add pool_setvendorclasses() method
mlschroe authored Mar 23, 2011
53 } Datapos;
4e94138 @mlschroe - move search position into pool
mlschroe authored Oct 9, 2008
54
428d753 @mlschroe - use correct defaults for rpm5, put tmpspace in extra struct
mlschroe authored Mar 28, 2011
55 struct _Pool_tmpspace {
56 char *buf[POOL_TMPSPACEBUF];
57 int len[POOL_TMPSPACEBUF];
58 int n;
59 };
60
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
61 struct _Pool {
e719644 @mlschroe - add appdata application private pointer to Pool/Repo
mlschroe authored Jun 23, 2009
62 void *appdata; /* application private pointer */
63
9e09e79 @susematz Reduce C&P code by factoring out the uniquifying string pool.
susematz authored Nov 16, 2007
64 struct _Stringpool ss;
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
65
65c03f6 @mlschroe - add pool_set_installed() function, remove no longer needed "installed"
mlschroe authored Oct 22, 2008
66 Reldep *rels; /* table of rels: Id -> Reldep */
67 int nrels; /* number of unique rels */
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
68
cdd0e99 @mlschroe - changed repo interface a bit, now alloc/free handle repo pointer and
mlschroe authored Nov 17, 2007
69 struct _Repo **repos;
2b400c1 @mlschroe - use FOR_REPODATAS macro
mlschroe authored Jun 14, 2011
70 int nrepos; /* repos allocated */
1a04759 @mlschroe - INCOMPATIBLE CHANGE: index with repoid (thus pool->repos[repoid] ==…
mlschroe authored Dec 22, 2011
71 int urepos; /* repos in use */
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
72
65c03f6 @mlschroe - add pool_set_installed() function, remove no longer needed "installed"
mlschroe authored Oct 22, 2008
73 struct _Repo *installed; /* packages considered installed */
74
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
75 Solvable *solvables;
2b400c1 @mlschroe - use FOR_REPODATAS macro
mlschroe authored Jun 14, 2011
76 int nsolvables; /* solvables allocated */
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
77
35bcf83 @mlschroe - fix bug in solv loading callback
mlschroe authored Mar 3, 2008
78 const char **languages;
79 int nlanguages;
80
d9da98e @mlschroe - add pool_addvendorclass and solver_solutionelement_internalid
mlschroe authored Feb 14, 2012
81 /* package manager type, deb/rpm */
82 int disttype;
83
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
84 Id *id2arch; /* map arch ids to scores */
539bae9 @mlschroe - add support for repository disabling
mlschroe authored Jul 9, 2009
85 unsigned char *id2color; /* map arch ids to colors */
86 Id lastarch; /* last valid entry in id2arch/id2color */
87
18871f0 @mlschroe - add vendor change policy (but fixes no test case, as there is no
mlschroe authored Oct 30, 2007
88 Queue vendormap; /* map vendor to vendorclasses mask */
18579bb @mlschroe - delete fixed vendor classes, add pool_setvendorclasses() method
mlschroe authored Mar 23, 2011
89 const char **vendorclasses; /* vendor equivalence classes */
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
90
91 /* providers data, as two-step indirect list
92 * whatprovides[Id] -> Offset into whatprovidesdata for name
ee69e96 @mlschroe - made parts of Pool private, removed inline from solv_chksum_len so …
mlschroe authored Feb 17, 2012
93 * whatprovidesdata[Offset] -> 0-terminated list of solvables providing Id
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
94 */
95 Offset *whatprovides; /* Offset to providers of a specific name, Id -> Offset */
709c648 @mlschroe - switch to new solv format using schemata
mlschroe authored Dec 4, 2007
96 Offset *whatprovides_rel; /* Offset to providers of a specific relation, Id -> Offset */
97
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
98 Id *whatprovidesdata; /* Ids of solvable providing Id */
99 Offset whatprovidesdataoff; /* next free slot within whatprovidesdata */
100 int whatprovidesdataleft; /* number of 'free slots' within whatprovidesdata */
90d3a66 @mlschroe - add support for namespace callbacks
mlschroe authored Oct 25, 2007
101
f93fa50 @susematz Introduce pool->considered. A map to select a subset of solvables for
susematz authored Feb 12, 2008
102 /* If nonzero, then consider only the solvables with Ids set in this
103 bitmap for solving. If zero, consider all solvables. */
104 Map *considered;
105
d9da98e @mlschroe - add pool_addvendorclass and solver_solutionelement_internalid
mlschroe authored Feb 14, 2012
106 /* callback for REL_NAMESPACE dependencies handled by the application */
90d3a66 @mlschroe - add support for namespace callbacks
mlschroe authored Oct 25, 2007
107 Id (*nscallback)(struct _Pool *, void *data, Id name, Id evr);
108 void *nscallbackdata;
8340c83 @mlschroe - move dep2str buffer into pool so that the memory gets released
mlschroe authored Oct 26, 2007
109
7cdf594 @mlschroe - changed debug mechanism a bit, it is now part of the pool
mlschroe authored Nov 28, 2007
110 /* debug mask and callback */
111 int debugmask;
599c0d9 @mlschroe - revert debugcallback Pool constness, as the callback may want to do
mlschroe authored Jun 22, 2009
112 void (*debugcallback)(struct _Pool *, void *data, int type, const char *str);
7cdf594 @mlschroe - changed debug mechanism a bit, it is now part of the pool
mlschroe authored Nov 28, 2007
113 void *debugcallbackdata;
dc242b8 @susematz Support for generating separate sub files and bugfixes in the reader
susematz authored Feb 10, 2008
114
115 /* load callback */
560f204 @mlschroe - add new flags for the load functions:
mlschroe authored Jul 14, 2009
116 int (*loadcallback)(struct _Pool *, struct _Repodata *, void *);
dc242b8 @susematz Support for generating separate sub files and bugfixes in the reader
susematz authored Feb 10, 2008
117 void *loadcallbackdata;
4e94138 @mlschroe - move search position into pool
mlschroe authored Oct 9, 2008
118
119 /* search position */
18579bb @mlschroe - delete fixed vendor classes, add pool_setvendorclasses() method
mlschroe authored Mar 23, 2011
120 Datapos pos;
ee69e96 @mlschroe - made parts of Pool private, removed inline from solv_chksum_len so …
mlschroe authored Feb 17, 2012
121
122 #ifdef LIBSOLV_INTERNAL
2f7a054 @mlschroe - make pool flags private, allow self conflicts for rpm, add pool_set…
mlschroe authored Feb 20, 2012
123 /* flags to tell the library how the installed package manager works */
124 int promoteepoch; /* true: missing epoch is replaced by epoch of dependency */
907753c @mlschroe - support distepoch handling in release, used by the M&M distros
mlschroe authored Mar 22, 2012
125 int havedistepoch; /* true: thr release part in the evr may contain a distepoch suffix */
2f7a054 @mlschroe - make pool flags private, allow self conflicts for rpm, add pool_set…
mlschroe authored Feb 20, 2012
126 int obsoleteusesprovides; /* true: obsoletes are matched against provides, not names */
127 int implicitobsoleteusesprovides; /* true: implicit obsoletes due to same name are matched against provides, not names */
128 int obsoleteusescolors; /* true: obsoletes check arch color */
129 int noinstalledobsoletes; /* true: ignore obsoletes of installed packages */
9719138 @mlschroe - change allowselfconflicts to forbidselfconflicts now that rpm also …
mlschroe authored Feb 22, 2012
130 int forbidselfconflicts; /* true: packages which conflict with itself are not installable */
2f7a054 @mlschroe - make pool flags private, allow self conflicts for rpm, add pool_set…
mlschroe authored Feb 20, 2012
131
17ea16d @mlschroe - get rid of DEBINA_SEMANTICS, add pool->noarchid, add DISTTYPE_ARCH
mlschroe authored Apr 3, 2012
132 Id noarchid; /* ARCH_NOARCH, ARCH_ALL, ARCH_ANY, ... */
133
ee69e96 @mlschroe - made parts of Pool private, removed inline from solv_chksum_len so …
mlschroe authored Feb 17, 2012
134 /* hash for rel unification */
135 Hashtable relhashtbl; /* hashtable: (name,evr,op)Hash -> Id */
136 Hashmask relhashmask;
137
138 Id *languagecache;
139 int languagecacheother;
140
141 /* our tmp space string space */
142 struct _Pool_tmpspace tmpspace;
5702cc4 @mlschroe - add pool_error and pool_errstr. get rid of lots of exit() calls.
mlschroe authored Apr 13, 2012
143
144 char *errstr; /* last error string */
145 int errstra; /* allocated space for errstr */
ee69e96 @mlschroe - made parts of Pool private, removed inline from solv_chksum_len so …
mlschroe authored Feb 17, 2012
146 #endif
147
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
148 };
149
d9da98e @mlschroe - add pool_addvendorclass and solver_solutionelement_internalid
mlschroe authored Feb 14, 2012
150 #define DISTTYPE_RPM 0
151 #define DISTTYPE_DEB 1
17ea16d @mlschroe - get rid of DEBINA_SEMANTICS, add pool->noarchid, add DISTTYPE_ARCH
mlschroe authored Apr 3, 2012
152 #define DISTTYPE_ARCH 2
910ad3a @mlschroe - add repodata_delete_uninternalized
mlschroe authored Oct 2, 2009
153
09f29f7 @mlschroe - rename all sat_ to solv_
mlschroe authored Jul 12, 2011
154 #define SOLV_FATAL (1<<0)
155 #define SOLV_ERROR (1<<1)
156 #define SOLV_WARN (1<<2)
157 #define SOLV_DEBUG_STATS (1<<3)
158 #define SOLV_DEBUG_RULE_CREATION (1<<4)
159 #define SOLV_DEBUG_PROPAGATE (1<<5)
160 #define SOLV_DEBUG_ANALYZE (1<<6)
161 #define SOLV_DEBUG_UNSOLVABLE (1<<7)
162 #define SOLV_DEBUG_SOLUTIONS (1<<8)
163 #define SOLV_DEBUG_POLICY (1<<9)
164 #define SOLV_DEBUG_RESULT (1<<10)
165 #define SOLV_DEBUG_JOB (1<<11)
166 #define SOLV_DEBUG_SOLVER (1<<12)
167 #define SOLV_DEBUG_TRANSACTION (1<<13)
168
169 #define SOLV_DEBUG_TO_STDERR (1<<30)
babe8a8 @mlschroe - add support for cutoff argument in file conflict checker
mlschroe authored Jun 20, 2009
170
2f7a054 @mlschroe - make pool flags private, allow self conflicts for rpm, add pool_set…
mlschroe authored Feb 20, 2012
171 #define POOL_FLAG_PROMOTEEPOCH 1
9719138 @mlschroe - change allowselfconflicts to forbidselfconflicts now that rpm also …
mlschroe authored Feb 22, 2012
172 #define POOL_FLAG_FORBIDSELFCONFLICTS 2
2f7a054 @mlschroe - make pool flags private, allow self conflicts for rpm, add pool_set…
mlschroe authored Feb 20, 2012
173 #define POOL_FLAG_OBSOLETEUSESPROVIDES 3
174 #define POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES 4
175 #define POOL_FLAG_OBSOLETEUSESCOLORS 5
176 #define POOL_FLAG_NOINSTALLEDOBSOLETES 6
907753c @mlschroe - support distepoch handling in release, used by the M&M distros
mlschroe authored Mar 22, 2012
177 #define POOL_FLAG_HAVEDISTEPOCH 7
2f7a054 @mlschroe - make pool flags private, allow self conflicts for rpm, add pool_set…
mlschroe authored Feb 20, 2012
178
34fd443 @mlschroe - set pool_id2color, fix comments
mlschroe authored Jan 11, 2012
179 /* ----------------------------------------------- */
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
180
181
182 /* mark dependencies with relation by setting bit31 */
183
184 #define MAKERELDEP(id) ((id) | 0x80000000)
185 #define ISRELDEP(id) (((id) & 0x80000000) != 0)
709c648 @mlschroe - switch to new solv format using schemata
mlschroe authored Dec 4, 2007
186 #define GETRELID(id) ((id) ^ 0x80000000) /* returns Id */
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
187 #define GETRELDEP(pool, id) ((pool)->rels + ((id) ^ 0x80000000)) /* returns Reldep* */
188
ef695b9 @mlschroe - support for legacy rewriting
mlschroe authored Oct 5, 2007
189 #define REL_GT 1
190 #define REL_EQ 2
191 #define REL_LT 4
192
193 #define REL_AND 16
194 #define REL_OR 17
195 #define REL_WITH 18
196 #define REL_NAMESPACE 19
e78a2b4 @mlschroe - support REL_ARCH
mlschroe authored Apr 4, 2008
197 #define REL_ARCH 20
0a5fdc0 @mlschroe - add support for REL_FILECONFLICT
mlschroe authored Jun 19, 2009
198 #define REL_FILECONFLICT 21
0589bfb @mlschroe - start support for Fedora comps format
mlschroe authored Feb 2, 2012
199 #define REL_COND 22
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
200
709c648 @mlschroe - switch to new solv format using schemata
mlschroe authored Dec 4, 2007
201 #if !defined(__GNUC__) && !defined(__attribute__)
202 # define __attribute__(x)
203 #endif
204
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
205 extern Pool *pool_create(void);
206 extern void pool_free(Pool *pool);
87c5e01 @mlschroe - add solv_strdup(), rename repo_freeallrepos() to pool_freeallrepos()
mlschroe authored Dec 22, 2011
207 extern void pool_freeallrepos(Pool *pool, int reuseids);
7a25bd3 @mlschroe - add solvable allocation functions
mlschroe authored Nov 16, 2007
208
910ad3a @mlschroe - add repodata_delete_uninternalized
mlschroe authored Oct 2, 2009
209 extern void pool_setdebuglevel(Pool *pool, int level);
210 #ifdef MULTI_SEMANTICS
211 extern void pool_setdisttype(Pool *pool, int disttype);
212 #endif
2f7a054 @mlschroe - make pool flags private, allow self conflicts for rpm, add pool_set…
mlschroe authored Feb 20, 2012
213 extern int pool_set_flag(Pool *pool, int flag, int value);
214 extern int pool_get_flag(Pool *pool, int flag);
18579bb @mlschroe - delete fixed vendor classes, add pool_setvendorclasses() method
mlschroe authored Mar 23, 2011
215 extern void pool_setvendorclasses(Pool *pool, const char **vendorclasses);
910ad3a @mlschroe - add repodata_delete_uninternalized
mlschroe authored Oct 2, 2009
216
599c0d9 @mlschroe - revert debugcallback Pool constness, as the callback may want to do
mlschroe authored Jun 22, 2009
217 extern void pool_debug(Pool *pool, int type, const char *format, ...) __attribute__((format(printf, 3, 4)));
1414c61 @mlschroe un-inline some functions, remove SAT_DEBUG_SCHUBI
mlschroe authored May 25, 2011
218 extern void pool_setdebugcallback(Pool *pool, void (*debugcallback)(struct _Pool *, void *data, int type, const char *str), void *debugcallbackdata);
219 extern void pool_setdebugmask(Pool *pool, int mask);
220 extern void pool_setloadcallback(Pool *pool, int (*cb)(struct _Pool *, struct _Repodata *, void *), void *loadcbdata);
221
7cdf594 @mlschroe - changed debug mechanism a bit, it is now part of the pool
mlschroe authored Nov 28, 2007
222
b53291b @mlschroe - clean up tmp space management
mlschroe authored Mar 4, 2008
223 extern char *pool_alloctmpspace(Pool *pool, int len);
f7dc6ef @mlschroe - add pool_freetmpspace, pool_tmpappend, pool_bin2hex, sat_dupappend,…
mlschroe authored Mar 3, 2011
224 extern void pool_freetmpspace(Pool *pool, const char *space);
a250cf2 @mlschroe - add pool_tmpjoin and sat_dupjoin helpers
mlschroe authored Jun 24, 2009
225 extern char *pool_tmpjoin(Pool *pool, const char *str1, const char *str2, const char *str3);
f7dc6ef @mlschroe - add pool_freetmpspace, pool_tmpappend, pool_bin2hex, sat_dupappend,…
mlschroe authored Mar 3, 2011
226 extern char *pool_tmpappend(Pool *pool, const char *str1, const char *str2, const char *str3);
227 extern const char *pool_bin2hex(Pool *pool, const unsigned char *buf, int len);
b53291b @mlschroe - clean up tmp space management
mlschroe authored Mar 4, 2008
228
65c03f6 @mlschroe - add pool_set_installed() function, remove no longer needed "installed"
mlschroe authored Oct 22, 2008
229 extern void pool_set_installed(Pool *pool, struct _Repo *repo);
230
5702cc4 @mlschroe - add pool_error and pool_errstr. get rid of lots of exit() calls.
mlschroe authored Apr 13, 2012
231 extern int pool_error(Pool *pool, int ret, const char *format, ...) __attribute__((format(printf, 3, 4)));
232 extern char *pool_errstr(Pool *pool);
233
cdd0e99 @mlschroe - changed repo interface a bit, now alloc/free handle repo pointer and
mlschroe authored Nov 17, 2007
234 /**
235 * Solvable management
236 */
7a25bd3 @mlschroe - add solvable allocation functions
mlschroe authored Nov 16, 2007
237 extern Id pool_add_solvable(Pool *pool);
238 extern Id pool_add_solvable_block(Pool *pool, int count);
239
240 extern void pool_free_solvable_block(Pool *pool, Id start, int count, int reuseids);
840d6dc @kkaempf More const
kkaempf authored Jun 22, 2009
241 static inline Solvable *pool_id2solvable(const Pool *pool, Id p)
cdd0e99 @mlschroe - changed repo interface a bit, now alloc/free handle repo pointer and
mlschroe authored Nov 17, 2007
242 {
243 return pool->solvables + p;
244 }
5e90275 @mlschroe - add repoid to repo struct
mlschroe authored Jun 15, 2009
245
31d9370 @mlschroe - clean up function names for shared library
mlschroe authored May 2, 2011
246 extern const char *pool_solvable2str(Pool *pool, Solvable *s);
247 static inline const char *pool_solvid2str(Pool *pool, Id p)
248 {
249 return pool_solvable2str(pool, pool->solvables + p);
250 }
251
35bcf83 @mlschroe - fix bug in solv loading callback
mlschroe authored Mar 3, 2008
252 void pool_set_languages(Pool *pool, const char **languages, int nlanguages);
fa43e22 @mlschroe - add pool_id2langid function
mlschroe authored May 9, 2008
253 Id pool_id2langid(Pool *pool, Id id, const char *lang, int create);
2ccfed4 @mlschroe - fix mem leaks
mlschroe authored Mar 3, 2008
254
2ad7460 @mlschroe - bring solvable_trivial_installable functions back in sync with pool…
mlschroe authored Mar 21, 2012
255 int solvable_trivial_installable_map(Solvable *s, Map *installedmap, Map *conflictsmap, Map *noobsoletesmap);
256 int solvable_trivial_installable_repo(Solvable *s, struct _Repo *installed, Map *noobsoletesmap);
257 int solvable_trivial_installable_queue(Solvable *s, Queue *installed, Map *noobsoletesmap);
1f5def8 @mlschroe - beautfy, rename & document
mlschroe authored Apr 11, 2008
258
259 void pool_create_state_maps(Pool *pool, Queue *installed, Map *installedmap, Map *conflictsmap);
2ccfed4 @mlschroe - fix mem leaks
mlschroe authored Mar 3, 2008
260
a7dd7d7 @mlschroe - add pool_match_nevr() to match a single solvable's nevr against
mlschroe authored May 6, 2008
261 int pool_match_nevr_rel(Pool *pool, Solvable *s, Id d);
42f00b0 @mlschroe - move create_obsolete_index to policy.c
mlschroe authored May 25, 2009
262 int pool_match_dep(Pool *pool, Id d1, Id d2);
a7dd7d7 @mlschroe - add pool_match_nevr() to match a single solvable's nevr against
mlschroe authored May 6, 2008
263
264 static inline int pool_match_nevr(Pool *pool, Solvable *s, Id d)
265 {
266 if (!ISRELDEP(d))
267 return d == s->name;
268 else
269 return pool_match_nevr_rel(pool, s, d);
270 }
35bcf83 @mlschroe - fix bug in solv loading callback
mlschroe authored Mar 3, 2008
271
7a25bd3 @mlschroe - add solvable allocation functions
mlschroe authored Nov 16, 2007
272
e50636a @dmacvicar - iterators for solver decisions
dmacvicar authored Oct 26, 2007
273 /**
274 * Prepares a pool for solving
275 */
62f60b3 @mlschroe - some more cleanup
mlschroe authored Nov 17, 2007
276 extern void pool_createwhatprovides(Pool *pool);
65c03f6 @mlschroe - add pool_set_installed() function, remove no longer needed "installed"
mlschroe authored Oct 22, 2008
277 extern void pool_addfileprovides(Pool *pool);
9f63ef7 @mlschroe - add idqinst parameter to pool_addfileprovides_queue so that it can …
mlschroe authored Mar 2, 2012
278 extern void pool_addfileprovides_queue(Pool *pool, Queue *idq, Queue *idqinst);
8f8a9ed @kkaempf current state of 'sat-solver'
kkaempf authored Oct 2, 2007
279 extern void pool_freewhatprovides(Pool *pool);
280 extern Id pool_queuetowhatprovides(Pool *pool, Queue *q);
281
b3821d1 @mlschroe - Change provide iterator from ID pointer to ID. Before, iterating
mlschroe authored Sep 17, 2008
282 extern Id pool_addrelproviders(Pool *pool, Id d);
62f60b3 @mlschroe - some more cleanup
mlschroe authored Nov 17, 2007
283
b3821d1 @mlschroe - Change provide iterator from ID pointer to ID. Before, iterating
mlschroe authored Sep 17, 2008
284 static inline Id pool_whatprovides(Pool *pool, Id d)
62f60b3 @mlschroe - some more cleanup
mlschroe authored Nov 17, 2007
285 {
286 Id v;
287 if (!ISRELDEP(d))
b3821d1 @mlschroe - Change provide iterator from ID pointer to ID. Before, iterating
mlschroe authored Sep 17, 2008
288 return pool->whatprovides[d];
709c648 @mlschroe - switch to new solv format using schemata
mlschroe authored Dec 4, 2007
289 v = GETRELID(d);
290 if (pool->whatprovides_rel[v])
b3821d1 @mlschroe - Change provide iterator from ID pointer to ID. Before, iterating
mlschroe authored Sep 17, 2008
291 return pool->whatprovides_rel[v];
62f60b3 @mlschroe - some more cleanup
mlschroe authored Nov 17, 2007
292 return pool_addrelproviders(pool, d);
293 }
294
94fde09 @mlschroe - add pool_whatprovides_ptr() helper
mlschroe authored Jan 26, 2009
295 static inline Id *pool_whatprovides_ptr(Pool *pool, Id d)
296 {
297 Id off = pool_whatprovides(pool, d);
298 return pool->whatprovidesdata + off;
299 }
300
d26640b @mlschroe - add pool_search() function to search the pool
mlschroe authored Feb 15, 2008
301 /* search the pool. the following filters are available:
302 * p - search just this solvable
303 * key - search only this key
304 * match - key must match this string
305 */
306 void pool_search(Pool *pool, Id p, Id key, const char *match, int flags, int (*callback)(void *cbdata, Solvable *s, struct _Repodata *data, struct _Repokey *key, struct _KeyValue *kv), void *cbdata);
307
f8393a7 @mlschroe - more cleanups:
mlschroe authored Oct 20, 2008
308 void pool_clear_pos(Pool *pool);
309
310
560f204 @mlschroe - add new flags for the load functions:
mlschroe authored Jul 14, 2009
311 typedef struct _DUChanges {
032a07a @mlschroe - move change calculation into pool
mlschroe authored Mar 14, 2008
312 const char *path;
313 int kbytes;
314 int files;
315 } DUChanges;
316
65c03f6 @mlschroe - add pool_set_installed() function, remove no longer needed "installed"
mlschroe authored Oct 22, 2008
317 void pool_calc_duchanges(Pool *pool, Map *installedmap, DUChanges *mps, int nmps);
318 int pool_calc_installsizechange(Pool *pool, Map *installedmap);
319 void pool_trivial_installable(Pool *pool, Map *installedmap, Queue *pkgs, Queue *res);
33a18aa @mlschroe - frontport solver_trivial_installable() change
mlschroe authored Mar 2, 2009
320 void pool_trivial_installable_noobsoletesmap(Pool *pool, Map *installedmap, Queue *pkgs, Queue *res, Map *noobsoletesmap);
935bd5c @mlschroe - provide yet another interface to check if packages are trivial
mlschroe authored Apr 16, 2008
321
4cd070f @mlschroe - fix noprovide handling in findupdate
mlschroe authored May 28, 2009
322 const char *pool_lookup_str(Pool *pool, Id entry, Id keyname);
323 Id pool_lookup_id(Pool *pool, Id entry, Id keyname);
c36ef29 @mlschroe - incompatible ABI change: switch num over to unsigned long long and …
mlschroe authored Mar 28, 2012
324 unsigned long long pool_lookup_num(Pool *pool, Id entry, Id keyname, unsigned long long notfound);
4cd070f @mlschroe - fix noprovide handling in findupdate
mlschroe authored May 28, 2009
325 int pool_lookup_void(Pool *pool, Id entry, Id keyname);
326 const unsigned char *pool_lookup_bin_checksum(Pool *pool, Id entry, Id keyname, Id *typep);
327 const char *pool_lookup_checksum(Pool *pool, Id entry, Id keyname, Id *typep);
328
0a5fdc0 @mlschroe - add support for REL_FILECONFLICT
mlschroe authored Jun 19, 2009
329 void pool_add_fileconflicts_deps(Pool *pool, Queue *conflicts);
330
331
032a07a @mlschroe - move change calculation into pool
mlschroe authored Mar 14, 2008
332
62f60b3 @mlschroe - some more cleanup
mlschroe authored Nov 17, 2007
333 /* loop over all providers of d */
334 #define FOR_PROVIDES(v, vp, d) \
b3821d1 @mlschroe - Change provide iterator from ID pointer to ID. Before, iterating
mlschroe authored Sep 17, 2008
335 for (vp = pool_whatprovides(pool, d) ; (v = pool->whatprovidesdata[vp++]) != 0; )
62f60b3 @mlschroe - some more cleanup
mlschroe authored Nov 17, 2007
336
f6f5492 @mlschroe - add FOR_REPOS macro to iterate over repos
mlschroe authored Jun 15, 2009
337 /* loop over all repositories */
1a04759 @mlschroe - INCOMPATIBLE CHANGE: index with repoid (thus pool->repos[repoid] ==…
mlschroe authored Dec 22, 2011
338 #define FOR_REPOS(repoid, r) \
339 for (repoid = 1; repoid < pool->nrepos; repoid++) \
340 if ((r = pool->repos[repoid]) != 0)
f6f5492 @mlschroe - add FOR_REPOS macro to iterate over repos
mlschroe authored Jun 15, 2009
341
342
fb73073 @mlschroe - hide repodata internals (needed to move repo_write from ext to src …
mlschroe authored Feb 17, 2012
343 #ifdef ENABLE_COMPS
344 #define ISCONDDEP(id) (ISRELDEP(id) && (GETRELDEP(pool, id))->flags == REL_COND)
345 #define MODIFYCONDDEP(id, tst) do { Reldep *condrd = GETRELDEP(pool, id); Id condp, condpp; FOR_PROVIDES(condrd->evr, condp, condpp) if (tst) break; id = condp ? condrd->name : 0;} while(0)
346 #endif
347
7cdf594 @mlschroe - changed debug mechanism a bit, it is now part of the pool
mlschroe authored Nov 28, 2007
348 #define POOL_DEBUG(type, ...) do {if ((pool->debugmask & (type)) != 0) pool_debug(pool, (type), __VA_ARGS__);} while (0)
349 #define IF_POOLDEBUG(type) if ((pool->debugmask & (type)) != 0)
62f60b3 @mlschroe - some more cleanup
mlschroe authored Nov 17, 2007
350
0fb02a1 @susematz Make the satsolver header usable with C++ (only pool.h and source_solv.h
susematz authored Oct 12, 2007
351 #ifdef __cplusplus
352 }
353 #endif
354
7cdf594 @mlschroe - changed debug mechanism a bit, it is now part of the pool
mlschroe authored Nov 28, 2007
355
4cd5d62 @mlschroe rename satsolver -> libsolv
mlschroe authored May 24, 2011
356 #endif /* LIBSOLV_POOL_H */
Something went wrong with that request. Please try again.