Also move it out of rpmlib.h, nothing needs it there...
/**
*/
struct orderListIndex_s {
- alKey pkgKey;
+ rpmalKey pkgKey;
int orIndex;
};
* @return 0 on success
*/
static int removePackage(rpmts ts, Header h, int dboffset,
- alKey depends)
+ rpmalKey depends)
{
rpmte p;
const char * os;
rpmds oldChk, newChk;
rpmds obsoletes;
- alKey pkgKey; /* addedPackages key */
+ rpmalKey pkgKey; /* addedPackages key */
int xx;
int ec = 0;
int rc;
tsortInfo tsi;
const char * Name;
fnpyKey key;
- alKey pkgKey;
+ rpmalKey pkgKey;
int i = 0;
if ((Name = rpmdsN(requires)) == NULL)
rpmtsi ri; rpmte r;
tsortInfo tsi;
tsortInfo tsi_next;
- alKey * ordering;
+ rpmalKey * ordering;
int orderingCount = 0;
unsigned char * selected = alloca(sizeof(*selected) * (ts->orderCount + 1));
int loopcheck;
* A single available item (e.g. a Provides: dependency).
*/
struct availableIndexEntry_s {
- alKey pkgKey; /*!< Containing package. */
+ rpmalKey pkgKey; /*!< Containing package. */
const char * entry; /*!< Dependency name. */
unsigned short entryLen; /*!< No. of bytes in name. */
unsigned short entryIx; /*!< Dependency index. */
struct fileIndexEntry_s {
const char * baseName; /*!< File basename. */
int baseNameLen;
- alNum pkgNum; /*!< Containing package index. */
+ rpmalNum pkgNum; /*!< Containing package index. */
uint_32 ficolor;
};
}
#endif
-static inline alNum alKey2Num(const rpmal al,
- alKey pkgKey)
+static inline rpmalNum alKey2Num(const rpmal al,
+ rpmalKey pkgKey)
{
- return ((alNum)pkgKey);
+ return ((rpmalNum)pkgKey);
}
-static inline alKey alNum2Key(const rpmal al,
- alNum pkgNum)
+static inline rpmalKey alNum2Key(const rpmal al,
+ rpmalNum pkgNum)
{
- return ((alKey)pkgNum);
+ return ((rpmalKey)pkgNum);
}
#ifdef DYING
* @return available package pointer
*/
static availablePackage alGetPkg(const rpmal al,
- alKey pkgKey)
+ rpmalKey pkgKey)
{
- alNum pkgNum = alKey2Num(al, pkgKey);
+ rpmalNum pkgNum = alKey2Num(al, pkgKey);
availablePackage alp = NULL;
if (al != NULL && pkgNum >= 0 && pkgNum < alGetSize(al)) {
return strcmp(a->baseName, b->baseName);
}
-void rpmalDel(rpmal al, alKey pkgKey)
+void rpmalDel(rpmal al, rpmalKey pkgKey)
{
- alNum pkgNum = alKey2Num(al, pkgKey);
+ rpmalNum pkgNum = alKey2Num(al, pkgKey);
availablePackage alp;
rpmfi fi;
return;
}
-alKey rpmalAdd(rpmal * alistp, alKey pkgKey, fnpyKey key,
+rpmalKey rpmalAdd(rpmal * alistp, rpmalKey pkgKey, fnpyKey key,
rpmds provides, rpmfi fi, uint_32 tscolor)
{
- alNum pkgNum;
+ rpmalNum pkgNum;
rpmal al;
availablePackage alp;
rpmalFreeIndex(al);
-assert(((alNum)(alp - al->list)) == pkgNum);
- return ((alKey)(alp - al->list));
+assert(((rpmalNum)(alp - al->list)) == pkgNum);
+ return ((rpmalKey)(alp - al->list));
}
/**
return strcmp(a->entry, b->entry);
}
-void rpmalAddProvides(rpmal al, alKey pkgKey, rpmds provides, uint_32 tscolor)
+void rpmalAddProvides(rpmal al, rpmalKey pkgKey, rpmds provides, uint_32 tscolor)
{
uint_32 dscolor;
const char * Name;
- alNum pkgNum = alKey2Num(al, pkgKey);
+ rpmalNum pkgNum = alKey2Num(al, pkgKey);
availableIndex ai = &al->index;
availableIndexEntry aie;
int ix;
ai->k = 0;
for (i = 0; i < al->size; i++) {
alp = al->list + i;
- rpmalAddProvides(al, (alKey)i, alp->provides, alp->tscolor);
+ rpmalAddProvides(al, (rpmalKey)i, alp->provides, alp->tscolor);
}
/* Reset size to the no. of provides added. */
}
fnpyKey *
-rpmalAllFileSatisfiesDepend(const rpmal al, const rpmds ds, alKey * keyp)
+rpmalAllFileSatisfiesDepend(const rpmal al, const rpmds ds, rpmalKey * keyp)
{
uint_32 tscolor;
uint_32 ficolor;
}
fnpyKey *
-rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds, alKey * keyp)
+rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds, rpmalKey * keyp)
{
availableIndex ai;
availableIndexEntry needle;
}
fnpyKey
-rpmalSatisfiesDepend(const rpmal al, const rpmds ds, alKey * keyp)
+rpmalSatisfiesDepend(const rpmal al, const rpmds ds, rpmalKey * keyp)
{
fnpyKey * tmp = rpmalAllSatisfiesDepend(al, ds, keyp);
*/
typedef struct rpmal_s * rpmal;
+/** \ingroup rpmtrans
+ * * An added/available package retrieval key.
+ * */
+typedef void * rpmalKey;
+#define RPMAL_NOMATCH ((rpmalKey)-1L)
+
+/** \ingroup rpmtrans
+ * * An added/available package retrieval index.
+ * */
+typedef intptr_t rpmalNum;
+
#ifdef __cplusplus
extern "C" {
#endif
* @param al available list
* @param pkgKey package key
*/
-void rpmalDel(rpmal al, alKey pkgKey);
+void rpmalDel(rpmal al, rpmalKey pkgKey);
/**
* Add package to available list.
* @param tscolor transaction color bits
* @return available package index
*/
-alKey rpmalAdd(rpmal * alistp,
- alKey pkgKey,
+rpmalKey rpmalAdd(rpmal * alistp,
+ rpmalKey pkgKey,
fnpyKey key,
rpmds provides, rpmfi fi,
uint_32 tscolor);
* @param tscolor transaction color bits
*/
void rpmalAddProvides(rpmal al,
- alKey pkgKey,
+ rpmalKey pkgKey,
rpmds provides, uint_32 tscolor);
/**
* @return associated package key(s), NULL if none
*/
fnpyKey * rpmalAllFileSatisfiesDepend(const rpmal al,
- const rpmds ds, alKey * keyp);
+ const rpmds ds, rpmalKey * keyp);
/**
* Check added package file lists for package(s) that have a provide.
* @return associated package key(s), NULL if none
*/
fnpyKey * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds,
- alKey * keyp);
+ rpmalKey * keyp);
/**
* Check added package file lists for first package that has a provide.
* @return associated package key, NULL if none
*/
fnpyKey rpmalSatisfiesDepend(const rpmal al, const rpmds ds,
- alKey * keyp);
+ rpmalKey * keyp);
#ifdef __cplusplus
}
*/
typedef struct Spec_s * Spec;
+#if 0
/** \ingroup rpmtrans
* An added/available package retrieval key.
*/
* An added/available package retrieval index.
*/
typedef intptr_t alNum;
+#endif
/** \ingroup rpmtrans
* Dependency tag sets from a header, so that a header can be discarded early.
fnpyKey key,
rpmRelocation * relocs,
int dboffset,
- alKey pkgKey)
+ rpmalKey pkgKey)
{
rpmte p = xcalloc(1, sizeof(*p));
int_32 * ep;
}
}
-alKey rpmteAddedKey(rpmte te)
+rpmalKey rpmteAddedKey(rpmte te)
{
return (te != NULL ? te->u.addedKey : RPMAL_NOMATCH);
}
-alKey rpmteSetAddedKey(rpmte te, alKey npkgKey)
+rpmalKey rpmteSetAddedKey(rpmte te, rpmalKey npkgKey)
{
- alKey opkgKey = RPMAL_NOMATCH;
+ rpmalKey opkgKey = RPMAL_NOMATCH;
if (te != NULL) {
opkgKey = te->u.addedKey;
te->u.addedKey = npkgKey;
}
-alKey rpmteDependsOnKey(rpmte te)
+rpmalKey rpmteDependsOnKey(rpmte te)
{
return (te != NULL ? te->u.removed.dependsOnKey : RPMAL_NOMATCH);
}
* Structures used for an "rpmte" transaction element.
*/
+#include "rpmal.h"
+
/**
*/
extern int _rpmte_debug;
FD_t fd; /*!< (TR_ADDED) Payload file descriptor. */
union {
- alKey addedKey;
+ rpmalKey addedKey;
struct {
- alKey dependsOnKey;
+ rpmalKey dependsOnKey;
int dboffset;
} removed;
} u;
fnpyKey key,
rpmRelocation * relocs,
int dboffset,
- alKey pkgKey);
+ rpmalKey pkgKey);
/**
* Retrieve header from transaction element.
* @param te transaction element
* @return pkgKey
*/
-alKey rpmteAddedKey(rpmte te);
+rpmalKey rpmteAddedKey(rpmte te);
/**
* Set pkgKey of TR_ADDED transaction element.
* @param npkgKey new pkgKey
* @return previous pkgKey
*/
-alKey rpmteSetAddedKey(rpmte te,
- alKey npkgKey);
+rpmalKey rpmteSetAddedKey(rpmte te,
+ rpmalKey npkgKey);
/**
* Retrieve dependent pkgKey of TR_REMOVED transaction element.
* @param te transaction element
* @return dependent pkgKey
*/
-alKey rpmteDependsOnKey(rpmte te);
+rpmalKey rpmteDependsOnKey(rpmte te);
/**
* Retrieve rpmdb instance of TR_REMOVED transaction element.
sharedFileInfo shared, sharedList;
int numShared;
int nexti;
- alKey lastFailKey;
+ rpmalKey lastFailKey;
fingerPrintCache fpc;
rpmps ps;
rpmpsm psm;
/* ===============================================
* Install and remove packages.
*/
- lastFailKey = (alKey)-2; /* erased packages have -1 */
+ lastFailKey = (rpmalKey)-2; /* erased packages have -1 */
pi = rpmtsiInit(ts);
/* FIX: fi reload needs work */
while ((p = rpmtsiNext(pi, 0)) != NULL) {
- alKey pkgKey;
+ rpmalKey pkgKey;
int gotfd;
gotfd = 0;
rpmdsObject * dso;
rpmfiObject * fio;
PyObject * key;
- alKey pkgKey;
+ rpmalKey pkgKey;
char * kwlist[] = {"packageKey", "key", "dso", "fileInfo", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "iOO!O!:Add", kwlist,
static PyObject *
rpmal_Del(rpmalObject * s, PyObject * args, PyObject * kwds)
{
- alKey pkgKey;
+ rpmalKey pkgKey;
char * kwlist[] = {"key", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "i:Del", kwlist, &pkgKey))
rpmal_AddProvides(rpmalObject * s, PyObject * args, PyObject * kwds)
{
rpmdsObject * dso;
- alKey pkgKey;
+ rpmalKey pkgKey;
char * kwlist[] = {"index", "packageIndex", "dso", NULL};
/* XXX: why is there an argument listed in the format string that