12 #define _RPMFI_INTERNAL
18 #define _RPMDS_INTERNAL
102 GENfree(availablePackage)
103 GENfree(availableIndexEntry)
138 availableIndex ai = &al->
index;
148 availablePackage alp;
151 if ((alp = al->
list) != NULL)
152 for (i = 0; i < al->
size; i++, alp++) {
175 if (_rpmalPool == NULL) {
181 memset(((
char *)al)+
sizeof(al->
_item), 0,
sizeof(*al)-
sizeof(al->
_item));
188 availableIndex ai = &al->
index;
204 availablePackage alp;
206 if (al == NULL || al->
list == NULL)
209 alp = al->
list + pkgNum;
218 memset(alp, 0,
sizeof(*alp));
227 availablePackage alp;
235 if (pkgNum >= 0 && pkgNum < al->
size) {
245 if (al->
list == NULL)
248 alp = al->
list + pkgNum;
261 assert(((
alNum)(alp - al->
list)) == pkgNum);
292 availableIndex ai = &al->
index;
293 availableIndexEntry aie;
296 if (provides == NULL || pkgNum < 0 || pkgNum >= al->
size)
298 if (ai->
index == NULL || ai->
k < 0 || ai->
k >= ai->
size)
304 if ((Name = provides->N[provides->i]) == NULL)
309 if (tscolor && dscolor && !(tscolor & dscolor))
319 aie->
entryLen = (
unsigned short)strlen(Name);
323 assert(ix < 0x10000);
333 availablePackage alp;
336 if (al == NULL || al->
list == NULL)
return;
340 for (i = 0; i < al->
size; i++) {
345 if (ai->
size == 0)
return;
349 for (i = 0; i < al->
size; i++) {
363 int found = 0, verified = 0;
370 if (al == NULL || (fn =
rpmdsN(ds)) == NULL || *fn !=
'/')
374 if (al->
list != NULL)
375 for (i = 0; i < al->
size; i++) {
376 availablePackage alp = al->
list +
i;
382 char * fifn = (
char *) malloc(alp->
fi->fnlen + 1);
383 for(j=0; j<(int)alp->
fi->fc; j++) {
384 const char * dn = NULL;
385 (void)
urlPath(alp->
fi->dnl[alp->
fi->dil[j]], &dn);
386 strcpy(
stpcpy(fifn, dn), alp->
fi->bnl[j]);
387 if (!strcmp(fn, fifn)) {
403 ret[found] = alp->
key;
422 availableIndexEntry needle;
423 availableIndexEntry match;
427 availablePackage alp;
433 if (al == NULL || ds == NULL || (KName =
rpmdsN(ds)) == NULL)
439 if (ret != NULL && *ret != NULL)
450 memset(
alloca(
sizeof(*needle)), 0,
sizeof(*needle));
452 needle->
entry = KName;
465 if (al->
list != NULL)
466 for (ret = NULL, found = 0;
474 switch (match->
type) {
492 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.
Structure(s) used for file info tag sets.
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.
rpmfi rpmfiFree(rpmfi fi)
Destroy a file info set.
static void rpmlog(int code, const char *fmt,...)
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
Yet Another syslog(3) API clone.
void * xcalloc(size_t nmemb, size_t size)
rpmbf rpmbfFree(rpmbf bf)
Destroy a Bloom filter.
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
urltype urlPath(const char *url, const char **pathp)
Return path component of URL.
const char const bson * key
rpmfi rpmfiLink(rpmfi fi, const char *msg)
Reference a file info set instance.
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.
char * stpcpy(char *dest, const char *src)
const char const char size_t size
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.
rpmbf rpmbfLink(rpmbf bf)
Reference a Bloom filter instance.
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.
const char const bson int num
int rpmbfChk(rpmbf bf, const void *_s, size_t ns)
Check for item in a Bloom filter.