Blame lib/rpmtriggers.h

2ff057
#ifndef _RPMTRIGGERS_H
2ff057
#define _RPMTRIGGERS_H
2ff057
2ff057
#include <rpm/rpmutil.h>
2ff057
#include "lib/rpmscript.h"
2ff057
2ff057
struct triggerInfo_s {
2ff057
    unsigned int hdrNum;
2ff057
    unsigned int tix;
2ff057
    unsigned int priority;
2ff057
};
2ff057
2ff057
typedef struct rpmtriggers_s {
2ff057
    struct triggerInfo_s *triggerInfo;
2ff057
    int count;
2ff057
    int alloced;
2ff057
} *rpmtriggers;
2ff057
2ff057
#ifdef __cplusplus
2ff057
extern "C" {
2ff057
#endif
2ff057
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
rpmtriggers rpmtriggersCreate(unsigned int hint);
2ff057
2ff057
RPM_GNUC_INTERNAL
2ff057
rpmtriggers rpmtriggersFree(rpmtriggers triggers);
2ff057
2ff057
/*
2ff057
 * Prepare post trans uninstall file triggers. After transcation uninstalled
2ff057
 * files are not saved anywhere. So we need during uninstalation of every
2ff057
 * package, in time when the files to uninstall are still available,
2ff057
 * to determine and store triggers that should be set off after transaction.
2ff057
 */
2ff057
RPM_GNUC_INTERNAL
2ff057
void rpmtriggersPrepPostUnTransFileTrigs(rpmts ts, rpmte te);
2ff057
2ff057
/* Run triggers stored in ts */
2ff057
RPM_GNUC_INTERNAL
2ff057
int runPostUnTransFileTrigs(rpmts ts);
2ff057
2ff057
/*
2ff057
 * It runs file triggers in other package(s) this package/transaction sets off.
2ff057
 * If tm is RPMSCRIPT_FILETRIGGERSCRIPT then it runs file triggers that are
2ff057
 * fired by files in transaction entry. If tm is RPMSCRIPT_TRANSFILETRIGGERSCRIPT
2ff057
 * then it runs file triggers that are fired by all files in transaction set.
2ff057
 * In that case te can be NULL.
2ff057
 *
2ff057
 * @param ts		transaction set
2ff057
 * @param te		transaction entry
2ff057
 * @param sense		defines which triggers should be set off (triggerin,
2ff057
 *			triggerun, triggerpostun)
2ff057
 * @param tm		trigger mode, (filetrigger/transfiletrigger)
2ff057
 * @param priorityClass	1 to run triggers that should be executed before
2ff057
 *			standard scriptlets
2ff057
 *			2 to run triggers that should be executed after
2ff057
 *			standard scriptlets
2ff057
 *			0 to run all triggers
2ff057
 */
2ff057
RPM_GNUC_INTERNAL
2ff057
rpmRC runFileTriggers(rpmts ts, rpmte te, rpmsenseFlags sense,
2ff057
			rpmscriptTriggerModes tm, int priorityClass);
2ff057
2ff057
/* Run file triggers in this te other package(s) set off.
2ff057
 * @param ts		transaction set
2ff057
 * @param te		transaction entry
2ff057
 * @param sense		defines which triggers should be set off (triggerin,
2ff057
 *			triggerun, triggerpostun)
2ff057
 * @param tm		trigger mode, (filetrigger/transfiletrigger)
2ff057
 * @param priorityClass	1 to run triggers that should be executed before
2ff057
 *			standard scriptlets
2ff057
 *			2 to run triggers that should be executed after
2ff057
 *			standard scriptlets
2ff057
 *			0 to run all triggers
2ff057
 */
2ff057
RPM_GNUC_INTERNAL
2ff057
rpmRC runImmedFileTriggers(rpmts ts, rpmte te, rpmsenseFlags sense,
2ff057
			    rpmscriptTriggerModes tm, int priorityClass);
2ff057
#ifdef __cplusplus
2ff057
}
2ff057
#endif
2ff057
#endif /* _RPMTRIGGERS_H */
2ff057