Add rpmfi get + set methods for file actions
This commit is contained in:
parent
23ce4966bb
commit
78df129248
18
lib/rpmfi.c
18
lib/rpmfi.c
|
@ -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;
|
||||||
|
|
14
lib/rpmfi.h
14
lib/rpmfi.h
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue