free(refs);
}
-rpmtsi rpmtsiFree(rpmtsi tsi)
-{
- /* XXX watchout: a funky recursion segfaults here iff nrefs is wrong. */
- if (tsi)
- tsi->ts = rpmtsFree(tsi->ts);
- return _free(tsi);
-}
-
-rpmtsi rpmtsiInit(rpmts ts)
-{
- rpmtsi tsi = NULL;
-
- tsi = xcalloc(1, sizeof(*tsi));
- tsi->ts = rpmtsLink(ts, RPMDBG_M("rpmtsi"));
- tsi->oc = 0;
- return tsi;
-}
-
-/**
- * Return next transaction element.
- * @param tsi transaction element iterator
- * @return transaction element, NULL on termination
- */
-static
-rpmte rpmtsiNextElement(rpmtsi tsi)
-{
- rpmte te = NULL;
- int oc = -1;
-
- if (tsi == NULL || tsi->ts == NULL || rpmtsNElements(tsi->ts) <= 0)
- return te;
-
- if (tsi->oc < rpmtsNElements(tsi->ts)) oc = tsi->oc++;
- if (oc != -1)
- te = rpmtsElement(tsi->ts, oc);
- return te;
-}
-
-rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type)
-{
- rpmte te;
-
- while ((te = rpmtsiNextElement(tsi)) != NULL) {
- if (type == 0 || (te->type & type) != 0)
- break;
- }
- return te;
-}
-
static Header rpmteDBHeader(rpmts ts, unsigned int rec)
{
Header h = NULL;
typedef struct tsortInfo_s * tsortInfo;
/** \ingroup rpmte
- * Transaction element iterator.
- */
-typedef struct rpmtsi_s * rpmtsi;
-
-/** \ingroup rpmte
* Transaction element type.
*/
typedef enum rpmElementType_e {
*/
void rpmteColorDS(rpmte te, rpmTag tag);
-/** \ingroup rpmte
- * Destroy transaction element iterator.
- * @param tsi transaction element iterator
- * @return NULL always
- */
-rpmtsi rpmtsiFree(rpmtsi tsi);
-
-/** \ingroup rpmte
- * Create transaction element iterator.
- * @param ts transaction set
- * @return transaction element iterator
- */
-rpmtsi rpmtsiInit(rpmts ts);
-
-/** \ingroup rpmte
- * Return next transaction element of type.
- * @param tsi transaction element iterator
- * @param type transaction element type selector (0 for any)
- * @return next transaction element of type, NULL on termination
- */
-rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type);
-
#ifdef __cplusplus
}
#endif
int allocatedReplaced;
};
-/**
- * Iterator across transaction elements, forward on install, backward on erase.
- */
-struct rpmtsi_s {
- rpmts ts; /*!< transaction set. */
- int oc; /*!< iterator index. */
-};
-
RPM_GNUC_INTERNAL
rpmfi rpmteSetFI(rpmte te, rpmfi fi);
#include "debug.h"
+/**
+ * Iterator across transaction elements, forward on install, backward on erase.
+ */
+struct rpmtsi_s {
+ rpmts ts; /*!< transaction set. */
+ int oc; /*!< iterator index. */
+};
+
static void loadKeyring(rpmts ts);
int _rpmts_debug = 0;
return rpmtsLink(ts, RPMDBG_M("tsCreate"));
}
+rpmtsi rpmtsiFree(rpmtsi tsi)
+{
+ /* XXX watchout: a funky recursion segfaults here iff nrefs is wrong. */
+ if (tsi)
+ tsi->ts = rpmtsFree(tsi->ts);
+ return _free(tsi);
+}
+
+rpmtsi rpmtsiInit(rpmts ts)
+{
+ rpmtsi tsi = NULL;
+
+ tsi = xcalloc(1, sizeof(*tsi));
+ tsi->ts = rpmtsLink(ts, RPMDBG_M("rpmtsi"));
+ tsi->oc = 0;
+ return tsi;
+}
+
+/**
+ * Return next transaction element.
+ * @param tsi transaction element iterator
+ * @return transaction element, NULL on termination
+ */
+static
+rpmte rpmtsiNextElement(rpmtsi tsi)
+{
+ rpmte te = NULL;
+ int oc = -1;
+
+ if (tsi == NULL || tsi->ts == NULL || rpmtsNElements(tsi->ts) <= 0)
+ return te;
+
+ if (tsi->oc < rpmtsNElements(tsi->ts)) oc = tsi->oc++;
+ if (oc != -1)
+ te = rpmtsElement(tsi->ts, oc);
+ return te;
+}
+
+rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type)
+{
+ rpmte te;
+
+ while ((te = rpmtsiNextElement(tsi)) != NULL) {
+ if (type == 0 || (rpmteType(te) & type) != 0)
+ break;
+ }
+ return te;
+}
#include <sys/types.h>
#include <rpm/rpmtypes.h>
+#include <rpm/rpmte.h>
#include <rpm/rpmps.h>
#include <rpm/rpmsw.h>
#include <rpm/rpmpgp.h>
*/
int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset);
+/** \ingroup rpmte
+ * Destroy transaction element iterator.
+ * @param tsi transaction element iterator
+ * @return NULL always
+ */
+rpmtsi rpmtsiFree(rpmtsi tsi);
+
+/** \ingroup rpmte
+ * Create transaction element iterator.
+ * @param ts transaction set
+ * @return transaction element iterator
+ */
+rpmtsi rpmtsiInit(rpmts ts);
+
+/** \ingroup rpmte
+ * Return next transaction element of type.
+ * @param tsi transaction element iterator
+ * @param type transaction element type selector (0 for any)
+ * @return next transaction element of type, NULL on termination
+ */
+rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type);
+
#ifdef __cplusplus
}
#endif
typedef struct rpmfi_s * rpmfi;
typedef struct rpmdb_s * rpmdb;
typedef struct rpmdbMatchIterator_s * rpmdbMatchIterator;
+typedef struct rpmtsi_s * rpmtsi;
+
typedef const void * fnpyKey;
typedef void * rpmCallbackData;
/** @} */