14 #define _RPMDS_INTERNAL 97 GENfree(availablePackage)
98 GENfree(availableIndexEntry)
133 availableIndex ai = &al->
index;
143 availablePackage alp;
146 if ((alp = al->
list) != NULL)
147 for (i = 0; i < al->
size; i++, alp++) {
150 (void)rpmbfFree(alp->
bf);
168 if (_rpmalPool == NULL) {
174 memset(((
char *)al)+
sizeof(al->
_item), 0,
sizeof(*al)-
sizeof(al->
_item));
181 availableIndex ai = &al->
index;
197 availablePackage alp;
199 if (al == NULL || al->
list == NULL)
202 alp = al->
list + pkgNum;
206 (void)rpmbfFree(alp->
bf);
209 memset(alp, 0,
sizeof(*alp));
218 availablePackage alp;
226 if (pkgNum >= 0 && pkgNum < al->size) {
236 if (al->
list == NULL)
239 alp = al->
list + pkgNum;
251 assert(((
alNum)(alp - al->
list)) == pkgNum);
261 static int indexcmp(
const void * one,
const void * two)
282 availableIndex ai = &al->
index;
283 availableIndexEntry aie;
286 if (provides == NULL || pkgNum < 0 || pkgNum >= al->
size)
288 if (ai->
index == NULL || ai->
k < 0 || ai->
k >= ai->
size)
294 if ((Name = provides->N[provides->i]) == NULL)
299 if (tscolor && dscolor && !(tscolor & dscolor))
309 aie->
entryLen = (
unsigned short)strlen(Name);
313 assert(ix < 0x10000);
323 availablePackage alp;
326 if (al == NULL || al->
list == NULL)
return;
330 for (i = 0; i < al->
size; i++) {
335 if (ai->
size == 0)
return;
339 for (i = 0; i < al->
size; i++) {
360 if (al == NULL || (fn =
rpmdsN(ds)) == NULL || *fn !=
'/')
364 if (al->
list != NULL)
365 for (i = 0; i < al->
size; i++) {
366 availablePackage alp = al->
list + i;
368 if (!rpmbfChk(alp->
bf, fn, nfn))
375 ret[found] = alp->
key;
394 availableIndexEntry needle;
395 availableIndexEntry match;
399 availablePackage alp;
404 if (al == NULL || ds == NULL || (KName =
rpmdsN(ds)) == NULL)
410 if (ret != NULL && *ret != NULL)
421 memset(
alloca(
sizeof(*needle)), 0,
sizeof(*needle));
423 needle->
entry = KName;
436 if (al->
list != NULL)
437 for (ret = NULL, found = 0;
445 switch (match->
type) {
461 ret[found] = alp->
key;
rpmds rpmdsInit(rpmds ds)
Initialize dependency set iterator.
rpmal rpmalLink(rpmal al, const char *msg)
Reference available list.
static void rpmalFreeIndex(rpmal al)
Destroy available item index.
A single available item (e.g.
int alNum
An added/available package retrieval index.
Index of all available items.
alKey rpmalAdd(rpmal *alistp, alKey pkgKey, fnpyKey key, rpmds provides, rpmfi fi, rpmuint32_t tscolor)
Add package to available list.
void * rpmfiFNBF(rpmfi fi)
Return FN Bloom filter from file info set.
static rpmal rpmalGetPool(rpmioPool pool)
struct rpmds_s * rpmds
Dependency tag sets from a header, so that a header can be discarded early.
rpmds rpmdsFree(rpmds ds)
Destroy a dependency set.
availableIndexEntry index
void * xcalloc(size_t nmemb, size_t size)
static void rpmalFini(void *_al)
struct availableIndexEntry_s * availableIndexEntry
rpmioItem rpmioGetPool(rpmioPool pool, size_t size)
Get unused item from pool, or alloc a new item.
rpmal rpmalNew(int delta)
Initialize available list.
static alNum alKey2Num(const rpmal al, alKey pkgKey)
struct rpmfi_s * rpmfi
File info tag sets from a header, so that a header can be discarded early.
int rpmdsCompare(const rpmds A, const rpmds B)
Compare two versioned dependency ranges, looking for overlap.
void rpmalAddProvides(rpmal al, alKey pkgKey, rpmds provides, rpmuint32_t tscolor)
Add package provides to available list index.
void rpmdsNotify(rpmds ds, const char *where, int rc)
Notify of results of dependency match.
Set of available packages, items, and directories.
int rpmdsNext(rpmds ds)
Return next dependency set iterator index.
Structure(s) used for dependency tag sets.
struct availableIndex_s index
int rpmdsCount(const rpmds ds)
Return dependency set count.
void * alKey
An added/available package retrieval key.
fnpyKey * rpmalAllFileSatisfiesDepend(const rpmal al, const rpmds ds, alKey *keyp)
Check added package file lists for package(s) that provide a file.
const char * rpmdsN(const rpmds ds)
Return current dependency name.
struct availableIndex_s * availableIndex
struct availablePackage_s * availablePackage
fnpyKey rpmalSatisfiesDepend(const rpmal al, const rpmds ds, alKey *keyp)
Check added package file lists for first package that has a provide.
rpmds rpmdsLink(rpmds ds, const char *msg)
Reference a dependency set instance.
rpmioPool rpmioNewPool(const char *name, size_t size, int limit, int flags, char *(*dbg)(void *item), void(*init)(void *item), void(*fini)(void *item))
Create a memory pool.
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
static int indexcmp(const void *one, const void *two)
Compare two available index entries by name (qsort/bsearch).
Info about a single package to be installed.
void rpmalDel(rpmal al, alKey pkgKey)
Delete package from available list.
int rpmdsIx(const rpmds ds)
Return dependency set index.
void rpmalMakeIndex(rpmal al)
Generate index for available list.
rpmuint32_t rpmdsColor(const rpmds ds)
Return current dependency color.
fnpyKey * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds, alKey *keyp)
Check added package file lists for package(s) that have a provide.
Structures used for managing added/available package lists.
static alKey alNum2Key(const rpmal al, alNum pkgNum)
int rpmdsSetIx(rpmds ds, int ix)
Set dependency set index.