summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-09-21 12:15:44 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-09-21 12:15:44 +0300
commit147f41bcc150d674ad86c714208c9a1f82218683 (patch)
treed2add52863196bcd88e4c6c18bfd0994b2d94c56
parentd712fcb5c1d56b5bdf26f378ce6b3273a9ada779 (diff)
downloadrpm-147f41bcc150d674ad86c714208c9a1f82218683.tar.gz
rpm-147f41bcc150d674ad86c714208c9a1f82218683.tar.bz2
rpm-147f41bcc150d674ad86c714208c9a1f82218683.zip
Differentiate between the possible te types and iterator selector values
- Transaction elements can only be of one type (hence the enum), but the transaction set iteration permits selecting more than one. Add a new typedef dummy for this purpose only.
-rw-r--r--lib/rpmte.h2
-rw-r--r--lib/rpmts.c4
-rw-r--r--lib/rpmts.h4
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/rpmte.h b/lib/rpmte.h
index 17854d7e4..b89c2ad1c 100644
--- a/lib/rpmte.h
+++ b/lib/rpmte.h
@@ -21,6 +21,8 @@ typedef enum rpmElementType_e {
TR_REMOVED = (1 << 1) /*!< Package will be removed. */
} rpmElementType;
+typedef rpmFlags rpmElementTypes;
+
/** \ingroup rpmte
* Retrieve header from transaction element.
* @param te transaction element
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 1bf58e91d..380ff00c3 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -990,12 +990,12 @@ rpmte rpmtsiNextElement(rpmtsi tsi)
return te;
}
-rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type)
+rpmte rpmtsiNext(rpmtsi tsi, rpmElementTypes types)
{
rpmte te;
while ((te = rpmtsiNextElement(tsi)) != NULL) {
- if (type == 0 || (rpmteType(te) & type) != 0)
+ if (types == 0 || (rpmteType(te) & types) != 0)
break;
}
return te;
diff --git a/lib/rpmts.h b/lib/rpmts.h
index a5e676dfb..fbf9a06c0 100644
--- a/lib/rpmts.h
+++ b/lib/rpmts.h
@@ -587,10 +587,10 @@ 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)
+ * @param types transaction element type selector (0 for any)
* @return next transaction element of type, NULL on termination
*/
-rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type);
+rpmte rpmtsiNext(rpmtsi tsi, rpmElementTypes types);
#ifdef __cplusplus
}