upgrade rpm version to 4.14.1
[platform/upstream/rpm.git] / lib / rpmfs.h
1 #ifndef _RPMFS_H
2 #define _RPMFS_H
3
4 #include <rpm/rpmfi.h>
5
6 /** \ingroup rpmfs
7  * Transaction element file states.
8  */
9 typedef struct rpmfs_s * rpmfs;
10 typedef struct sharedFileInfo_s * sharedFileInfo;
11 typedef char rpm_fstate_t;
12
13 /* XXX psm needs access to these */
14 struct sharedFileInfo_s {
15     int pkgFileNum;
16     int otherPkg;
17     int otherFileNum;
18     char rstate;
19 };
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 RPM_GNUC_INTERNAL
26 rpmfs rpmfsNew(rpm_count_t fc, int initState);
27
28 RPM_GNUC_INTERNAL
29 rpmfs rpmfsFree(rpmfs fs);
30
31 RPM_GNUC_INTERNAL
32 rpm_count_t rpmfsFC(rpmfs fs);
33
34 RPM_GNUC_INTERNAL
35 void rpmfsAddReplaced(rpmfs fs, int pkgFileNum, char rstate,
36                         int otherPkg, int otherFileNum);
37
38 RPM_GNUC_INTERNAL
39 sharedFileInfo rpmfsGetReplaced(rpmfs fs);
40
41 RPM_GNUC_INTERNAL
42 sharedFileInfo rpmfsNextReplaced(rpmfs fs , sharedFileInfo replaced);
43
44 RPM_GNUC_INTERNAL
45 void rpmfsSetState(rpmfs fs, unsigned int ix, rpmfileState state);
46
47 RPM_GNUC_INTERNAL
48 rpmfileState rpmfsGetState(rpmfs fs, unsigned int ix);
49
50 /* May return NULL */
51 RPM_GNUC_INTERNAL
52 rpm_fstate_t * rpmfsGetStates(rpmfs fs);
53
54 RPM_GNUC_INTERNAL
55 rpmFileAction rpmfsGetAction(rpmfs fs, unsigned int ix);
56
57 RPM_GNUC_INTERNAL
58 void rpmfsSetAction(rpmfs fs, unsigned int ix, rpmFileAction action);
59
60 RPM_GNUC_INTERNAL
61 void rpmfsResetActions(rpmfs fs);
62
63 #ifdef __cplusplus
64 }
65 #endif
66
67 #endif /* _RPMFS_H */