Add rpmfi get + set methods for file actions

This commit is contained in:
Panu Matilainen 2008-11-11 22:09:48 +02:00
parent 23ce4966bb
commit 78df129248
2 changed files with 32 additions and 0 deletions

View File

@ -393,6 +393,24 @@ const char * rpmfiFCaps(rpmfi fi)
return fcaps; return fcaps;
} }
rpmFileAction rpmfiFAction(rpmfi fi)
{
rpmFileAction action;
if (fi != NULL && fi->actions != NULL && fi->i >= 0 && fi->i < fi->fc) {
action = fi->actions[fi->i];
} else {
action = fi ? fi->action : FA_UNKNOWN;
}
return action;
}
void rpmfiSetFAction(rpmfi fi, rpmFileAction action)
{
if (fi != NULL && fi->actions != NULL && fi->i >= 0 && fi->i < fi->fc) {
fi->actions[fi->i] = action;
}
}
int rpmfiNext(rpmfi fi) int rpmfiNext(rpmfi fi)
{ {
int i = -1; int i = -1;

View File

@ -336,6 +336,20 @@ const char * rpmfiFGroup(rpmfi fi);
*/ */
const char * rpmfiFCaps(rpmfi fi); const char * rpmfiFCaps(rpmfi fi);
/** \ingroup rpmfi
* Return current file action from file info set.
* @param fi file info set
* @return current file action
*/
rpmFileAction rpmfiFAction(rpmfi fi);
/** \ingroup rpmfi
* Set current file action on file info set.
* @param fi file info set
* @param action file action
*/
void rpmfiSetFAction(rpmfi fi, rpmFileAction action);
/** \ingroup rpmfi /** \ingroup rpmfi
* Return next file iterator index. * Return next file iterator index.
* @param fi file info set * @param fi file info set