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.
This commit is contained in:
Panu Matilainen 2010-09-21 12:15:44 +03:00
parent d712fcb5c1
commit 147f41bcc1
3 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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;

View File

@ -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
}