rpm  5.4.15
Macros | Typedefs | Functions | Variables
rpmal.h File Reference

Structures used for managing added/available package lists. More...

#include <rpmds.h>
#include <rpmfi.h>
Include dependency graph for rpmal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RPMAL_NOMATCH   ((alKey)-1L)
 
#define rpmalUnlink(_al, _msg)   ((rpmal)rpmioUnlinkPoolItem((rpmioItem)(_al), _msg, __FILE__, __LINE__))
 
#define rpmalLink(_al, _msg)   ((rpmal)rpmioLinkPoolItem((rpmioItem)(_al), _msg, __FILE__, __LINE__))
 
#define rpmalFree(_al)   ((rpmal)rpmioFreePoolItem((rpmioItem)(_al), __FUNCTION__, __FILE__, __LINE__))
 

Typedefs

typedef int alNum
 An added/available package retrieval index. More...
 
typedef struct rpmal_srpmal
 

Functions

rpmal rpmalUnlink (rpmal al, const char *msg)
 Unreference available list. More...
 
rpmal rpmalLink (rpmal al, const char *msg)
 Reference available list. More...
 
rpmal rpmalFree (rpmal al)
 Destroy available list. More...
 
rpmal rpmalNew (int delta)
 Initialize available list. More...
 
void rpmalDel (rpmal al, alKey pkgKey)
 Delete package from available list. More...
 
alKey rpmalAdd (rpmal *alistp, alKey pkgKey, fnpyKey key, rpmds provides, rpmfi fi, rpmuint32_t tscolor)
 Add package to available list. More...
 
void rpmalAddProvides (rpmal al, alKey pkgKey, rpmds provides, rpmuint32_t tscolor)
 Add package provides to available list index. More...
 
void rpmalMakeIndex (rpmal al)
 Generate index for available list. More...
 
fnpyKeyrpmalAllFileSatisfiesDepend (const rpmal al, const rpmds ds, alKey *keyp)
 Check added package file lists for package(s) that provide a file. More...
 
fnpyKeyrpmalAllSatisfiesDepend (const rpmal al, const rpmds ds, alKey *keyp)
 Check added package file lists for package(s) that have a provide. More...
 
fnpyKey rpmalSatisfiesDepend (const rpmal al, const rpmds ds, alKey *keyp)
 Check added package file lists for first package that has a provide. More...
 

Variables

int _rpmal_debug
 

Detailed Description

Structures used for managing added/available package lists.

Definition in file rpmal.h.

Macro Definition Documentation

#define RPMAL_NOMATCH   ((alKey)-1L)
#define rpmalFree (   _al)    ((rpmal)rpmioFreePoolItem((rpmioItem)(_al), __FUNCTION__, __FILE__, __LINE__))

Definition at line 67 of file rpmal.h.

#define rpmalLink (   _al,
  _msg 
)    ((rpmal)rpmioLinkPoolItem((rpmioItem)(_al), _msg, __FILE__, __LINE__))

Definition at line 56 of file rpmal.h.

#define rpmalUnlink (   _al,
  _msg 
)    ((rpmal)rpmioUnlinkPoolItem((rpmioItem)(_al), _msg, __FILE__, __LINE__))

Definition at line 44 of file rpmal.h.

Typedef Documentation

typedef int alNum

An added/available package retrieval index.

Definition at line 23 of file rpmal.h.

typedef struct rpmal_s* rpmal

Definition at line 28 of file rpmal.h.

Function Documentation

alKey rpmalAdd ( rpmal alistp,
alKey  pkgKey,
fnpyKey  key,
rpmds  provides,
rpmfi  fi,
rpmuint32_t  tscolor 
)

Add package to available list.

Parameters
alistpaddress of available list
pkgKeypackage key, RPMAL_NOMATCH to force an append
keyassociated file name/python object
providesprovides dependency set
fifile info set
tscolortransaction color bits
Returns
available package index

Definition at line 222 of file rpmal.c.

References alKey2Num(), rpmal_s::alloced, availablePackage_s::bf, rpmal_s::delta, availablePackage_s::fi, availablePackage_s::key, key, rpmal_s::list, availablePackage_s::provides, RPMAL_NOMATCH, rpmalDel(), rpmalFreeIndex(), rpmalNew(), rpmbfLink(), rpmdsLink(), rpmfiFNBF(), rpmfiLink(), rpmal_s::size, size, availablePackage_s::tscolor, and xrealloc.

Referenced by _orgrpmtsOrder(), _rpmtsOrder(), rpmal_Add(), and rpmtsAddInstallElement().

void rpmalAddProvides ( rpmal  al,
alKey  pkgKey,
rpmds  provides,
rpmuint32_t  tscolor 
)

Add package provides to available list index.

Parameters
alavailable list
pkgKeypackage key
providesadded package provides
tscolortransaction color bits

Definition at line 287 of file rpmal.c.

References alKey2Num(), availableIndexEntry_s::entry, availableIndexEntry_s::entryIx, availableIndexEntry_s::entryLen, IET_PROVIDES, availableIndex_s::index, rpmal_s::index, availableIndex_s::k, availableIndexEntry_s::pkgKey, rpmdsColor(), rpmdsInit(), rpmdsIx(), rpmdsNext(), availableIndex_s::size, rpmal_s::size, and availableIndexEntry_s::type.

Referenced by rpmal_AddProvides(), and rpmalMakeIndex().

fnpyKey* rpmalAllFileSatisfiesDepend ( const rpmal  al,
const rpmds  ds,
alKey keyp 
)

Check added package file lists for package(s) that provide a file.

Parameters
alavailable list
dsdependency set
Return values
keypadded package key pointer (or NULL)
Returns
associated package key(s), NULL if none

Definition at line 360 of file rpmal.c.

References _, alNum2Key(), availablePackage_s::bf, availablePackage_s::fi, i, j, availablePackage_s::key, rpmal_s::list, RPMAL_NOMATCH, rpmbfChk(), rpmdsN(), rpmdsNotify(), rpmlog(), RPMLOG_DEBUG, rpmal_s::size, stpcpy(), urlPath(), and xrealloc.

Referenced by rpmalAllSatisfiesDepend().

fnpyKey* rpmalAllSatisfiesDepend ( const rpmal  al,
const rpmds  ds,
alKey keyp 
)

Check added package file lists for package(s) that have a provide.

Parameters
alavailable list
dsdependency set
Return values
keypadded package key pointer (or NULL)
Returns
associated package key(s), NULL if none

Definition at line 419 of file rpmal.c.

References _, _free(), alKey2Num(), alloca(), availableIndexEntry_s::entry, availableIndexEntry_s::entryIx, availableIndexEntry_s::entryLen, IET_PROVIDES, availableIndex_s::index, rpmal_s::index, indexcmp(), availablePackage_s::key, rpmal_s::list, availableIndexEntry_s::pkgKey, availablePackage_s::provides, RPMAL_NOMATCH, rpmalAllFileSatisfiesDepend(), rpmdsCompare(), rpmdsIx(), rpmdsN(), rpmdsNext(), rpmdsNotify(), rpmdsSetIx(), availableIndex_s::size, availableIndexEntry_s::type, and xrealloc.

Referenced by checkPackageDeps(), rpmalSatisfiesDepend(), and rpmtsAvailable().

void rpmalDel ( rpmal  al,
alKey  pkgKey 
)

Delete package from available list.

Parameters
alavailable list
pkgKeypackage key

Definition at line 201 of file rpmal.c.

References alKey2Num(), availablePackage_s::bf, availablePackage_s::fi, rpmal_s::list, availablePackage_s::provides, rpmbfFree(), rpmdsFree(), and rpmfiFree().

Referenced by rpmal_Del(), and rpmalAdd().

rpmal rpmalFree ( rpmal  al)

Destroy available list.

Parameters
alavailable list
Returns
NULL on last dereference

Referenced by _orgrpmtsOrder(), _rpmtsOrder(), rpmal_dealloc(), rpmtsClean(), and rpmtsFini().

rpmal rpmalLink ( rpmal  al,
const char *  msg 
)

Reference available list.

Parameters
alavailable list
msg
Returns
new available list reference

Referenced by rpmalNew().

void rpmalMakeIndex ( rpmal  al)
rpmal rpmalNew ( int  delta)

Initialize available list.

Parameters
deltano. of entries to add on each realloc
Returns
al new available list

Definition at line 185 of file rpmal.c.

References rpmal_s::alloced, rpmal_s::delta, availableIndex_s::index, rpmal_s::index, rpmal_s::list, rpmalGetPool(), rpmalLink(), availableIndex_s::size, rpmal_s::size, and xcalloc().

Referenced by rpmalAdd().

fnpyKey rpmalSatisfiesDepend ( const rpmal  al,
const rpmds  ds,
alKey keyp 
)

Check added package file lists for first package that has a provide.

Todo:
Eliminate.
Parameters
alavailable list
dsdependency set
Return values
keypadded package key pointer (or NULL)
Returns
associated package key, NULL if none

Definition at line 511 of file rpmal.c.

References rpmalAllSatisfiesDepend().

Referenced by addRelation(), orgrpmAddRelation(), and unsatisfiedDepend().

rpmal rpmalUnlink ( rpmal  al,
const char *  msg 
)

Unreference available list.

Parameters
alavailable list
msg
Returns
NULL on last dereference

Variable Documentation

int _rpmal_debug

Definition at line 35 of file rpmal.c.

Referenced by rpmalGetPool().