7f191140620eaa4275eab978094addad1799301b
[platform/upstream/rpm.git] / lib / fsm.h
1 #ifndef H_FSM
2 #define H_FSM
3
4 /** \ingroup payload
5  * \file lib/fsm.h
6  * File state machine to handle a payload within an rpm package.
7  */
8
9 #include <rpm/rpmfi.h>
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 typedef struct rpmpsm_s * rpmpsm;
16
17 /**
18  * Execute a file actions for package
19  * @param ts            transaction set
20  * @param fi            transaction element file info
21  * @param cfd
22  * @param psm           owner psm (or NULL)
23  * @retval archiveSize  pointer to archive size
24  * @retval failedFile   pointer to first file name that failed (malloced)
25  * @return              0 on success
26  */
27
28 int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfi fi, FD_t cfd,
29               rpmpsm psm, char ** failedFile);
30
31 int rpmPackageFilesRemove(rpmts ts, rpmte te, rpmfi fi,
32               rpmpsm psm, char ** failedFile);
33
34 int rpmPackageFilesArchive(rpmfi fi, int isSrc, FD_t cfd,
35               rpm_loff_t * archiveSize, char ** failedFile);
36
37 RPM_GNUC_INTERNAL
38 void rpmpsmNotify(rpmpsm psm, int what, rpm_loff_t amount);
39 #ifdef __cplusplus
40 }
41 #endif
42
43 #endif  /* H_FSM */