Add macro %isu_package to generate ISU Package
[platform/upstream/rpm.git] / lib / rpmts_internal.h
1 #ifndef _RPMTS_INTERNAL_H
2 #define _RPMTS_INTERNAL_H
3
4 #include <rpm/rpmts.h>
5 #include <rpm/rpmstrpool.h>
6
7 #include "lib/rpmal.h"          /* XXX availablePackage */
8 #include "lib/fprint.h"
9 #include "lib/rpmlock.h"
10 #include "lib/rpmdb_internal.h"
11 #include "lib/rpmscript.h"
12 #include "lib/rpmtriggers.h"
13
14 typedef struct diskspaceInfo_s * rpmDiskSpaceInfo;
15
16 /* Transaction set elements information */
17 typedef struct tsMembers_s {
18     rpmstrPool pool;            /*!< Global string pool */
19     packageHash removedPackages;        /*!< Set of packages being removed. */
20     packageHash installedPackages;      /*!< Set of installed packages */
21     rpmal addedPackages;        /*!< Set of packages being installed. */
22
23     rpmds rpmlib;               /*!< rpmlib() dependency set. */
24     rpmte * order;              /*!< Packages sorted by dependencies. */
25     int orderCount;             /*!< No. of transaction elements. */
26     int orderAlloced;           /*!< No. of allocated transaction elements. */
27     int delta;                  /*!< Delta for reallocation. */
28 } * tsMembers;
29
30 typedef struct tsTrigger_s {
31     unsigned int hdrNum;
32     int index;
33 } tsTrigger;
34
35 typedef struct tsTriggers_s {
36     tsTrigger *trigger;
37     int count;
38     int alloced;
39 } tsTriggers;
40
41 /** \ingroup rpmts
42  * The set of packages to be installed/removed atomically.
43  */
44 struct rpmts_s {
45     rpmtransFlags transFlags;   /*!< Bit(s) to control operation. */
46
47     int (*solve) (rpmts ts, rpmds key, const void * data);
48                                 /*!< Search for NEVRA key. */
49     const void * solveData;     /*!< Solve callback data */
50
51     rpmCallbackFunction notify; /*!< Callback function. */
52     rpmCallbackData notifyData; /*!< Callback private data. */
53
54     rpmprobFilterFlags ignoreSet;
55                                 /*!< Bits to filter current problems. */
56
57     rpmDiskSpaceInfo dsi;       /*!< Per filesystem disk/inode usage. */
58
59     rpmdb rdb;                  /*!< Install database handle. */
60     int dbmode;                 /*!< Install database open mode. */
61
62     tsMembers members;          /*!< Transaction set member info (order etc) */
63
64     char * rootDir;             /*!< Path to top of install tree. */
65     char * lockPath;            /*!< Transaction lock path */
66     rpmlock lock;               /*!< Transaction lock file */
67     FD_t scriptFd;              /*!< Scriptlet stdout/stderr. */
68     rpm_tid_t tid;              /*!< Transaction id. */
69
70     rpm_color_t color;          /*!< Transaction color bits. */
71     rpm_color_t prefcolor;      /*!< Preferred file color. */
72
73     rpmVSFlags vsflags;         /*!< Signature/digest verification flags. */
74
75     rpmKeyring keyring;         /*!< Keyring in use. */
76
77     ARGV_t netsharedPaths;      /*!< From %{_netsharedpath} */
78     ARGV_t installLangs;        /*!< From %{_install_langs} */
79
80     struct rpmop_s ops[RPMTS_OP_MAX];
81
82     rpmPlugins plugins;         /*!< Transaction plugins */
83
84     int nrefs;                  /*!< Reference count. */
85
86     rpmtriggers trigs2run;   /*!< Transaction file triggers */
87
88     int min_writes;             /*!< macro minimize_writes used */
89 };
90
91 #ifdef __cplusplus
92 extern "C" {
93 #endif
94
95 /** \ingroup rpmts
96  * Return transaction global string pool handle, creating the pool if needed.
97  * @param ts            transaction set
98  * @return              string pool handle (weak ref)
99  */
100 RPM_GNUC_INTERNAL
101 rpmstrPool rpmtsPool(rpmts ts);
102
103 RPM_GNUC_INTERNAL
104 tsMembers rpmtsMembers(rpmts ts);
105
106 /* Return rpmdb iterator with removals optionally pruned out */
107 RPM_GNUC_INTERNAL
108 rpmdbMatchIterator rpmtsPrunedIterator(rpmts ts, rpmDbiTagVal tag,
109                                               const char * key, int prune);
110
111 RPM_GNUC_INTERNAL
112 rpmal rpmtsCreateAl(rpmts ts, rpmElementTypes types);
113
114 /* returns -1 for retry, 0 for ignore and 1 for not found */
115 RPM_GNUC_INTERNAL
116 int rpmtsSolve(rpmts ts, rpmds key);
117
118 RPM_GNUC_INTERNAL
119 rpmRC rpmtsSetupTransactionPlugins(rpmts ts);
120
121 RPM_GNUC_INTERNAL
122 rpmRC runScript(rpmts ts, rpmte te, Header h, ARGV_const_t prefixes,
123                        rpmScript script, int arg1, int arg2);
124
125 #ifdef __cplusplus
126 }
127 #endif
128 #endif /* _RPMTS_INTERNAL_H */