diff --git a/lib/rpmfi.c b/lib/rpmfi.c index c41721af5..435c9864e 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -393,6 +393,24 @@ const char * rpmfiFCaps(rpmfi fi) 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 i = -1; diff --git a/lib/rpmfi.h b/lib/rpmfi.h index fd9cb6350..951f9763e 100644 --- a/lib/rpmfi.h +++ b/lib/rpmfi.h @@ -336,6 +336,20 @@ const char * rpmfiFGroup(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 * Return next file iterator index. * @param fi file info set