Sanitize python object -> tag number exception handling
[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
6 #include "lib/rpmal.h"          /* XXX availablePackage */
7 #include "lib/rpmhash.h"        /* XXX hashTable */
8 #include "lib/fprint.h"
9
10 /** \ingroup rpmts
11  */
12 typedef struct diskspaceInfo_s * rpmDiskSpaceInfo;
13
14 /** \ingroup rpmts
15  */
16 struct diskspaceInfo_s {
17     dev_t dev;          /*!< File system device number. */
18     int64_t bneeded;    /*!< No. of blocks needed. */
19     int64_t ineeded;    /*!< No. of inodes needed. */
20     int64_t bsize;      /*!< File system block size. */
21     int64_t bavail;     /*!< No. of blocks available. */
22     int64_t iavail;     /*!< No. of inodes available. */
23 };
24
25 /** \ingroup rpmts
26  * Adjust for root only reserved space. On linux e2fs, this is 5%.
27  */
28 #define adj_fs_blocks(_nb)      (((_nb) * 21) / 20)
29
30 /* argon thought a shift optimization here was a waste of time...  he's
31    probably right :-( */
32 #define BLOCK_ROUND(size, block) (((size) + (block) - 1) / (block))
33
34
35 /** \ingroup rpmts
36  * The set of packages to be installed/removed atomically.
37  */
38 struct rpmts_s {
39     rpmtransFlags transFlags;   /*!< Bit(s) to control operation. */
40
41     int (*solve) (rpmts ts, rpmds key, const void * data);
42                                 /*!< Search for NEVRA key. */
43     const void * solveData;     /*!< Solve callback data */
44
45     rpmCallbackFunction notify; /*!< Callback function. */
46     rpmCallbackData notifyData; /*!< Callback private data. */
47
48     rpmps probs;                /*!< Current problems in transaction. */
49     rpmprobFilterFlags ignoreSet;
50                                 /*!< Bits to filter current problems. */
51
52     unsigned int filesystemCount;       /*!< No. of mounted filesystems. */
53     const char ** filesystems;  /*!< Mounted filesystem names. */
54     rpmDiskSpaceInfo dsi;       /*!< Per filesystem disk/inode usage. */
55
56     rpmdb rdb;                  /*!< Install database handle. */
57     int dbmode;                 /*!< Install database open mode. */
58
59     int * removedPackages;      /*!< Set of packages being removed. */
60     int numRemovedPackages;     /*!< No. removed package instances. */
61     int allocedRemovedPackages; /*!< Size of removed packages array. */
62
63     rpmal addedPackages;        /*!< Set of packages being installed. */
64     int numAddedPackages;       /*!< No. added package instances. */
65
66     rpmte * order;              /*!< Packages sorted by dependencies. */
67     int orderCount;             /*!< No. of transaction elements. */
68     int orderAlloced;           /*!< No. of allocated transaction elements. */
69     int ntrees;                 /*!< No. of dependency trees. */
70     int maxDepth;               /*!< Maximum depth of dependency tree(s). */
71
72     int selinuxEnabled;         /*!< Is SE linux enabled? */
73     int chrootDone;             /*!< Has chroot(2) been been done? */
74     char * rootDir;             /*!< Path to top of install tree. */
75     char * currDir;             /*!< Current working directory. */
76     FD_t scriptFd;              /*!< Scriptlet stdout/stderr. */
77     int delta;                  /*!< Delta for reallocation. */
78     rpm_tid_t tid;              /*!< Transaction id. */
79
80     rpm_color_t color;          /*!< Transaction color bits. */
81     rpm_color_t prefcolor;      /*!< Preferred file color. */
82
83     rpmVSFlags vsflags;         /*!< Signature/digest verification flags. */
84
85     rpmKeyring keyring;         /*!< Keyring in use. */
86
87     ARGV_t netsharedPaths;      /*!< From %{_netsharedpath} */
88     ARGV_t installLangs;        /*!< From %{_install_langs} */
89
90     struct rpmop_s ops[RPMTS_OP_MAX];
91
92     rpmSpec spec;               /*!< Spec file control structure. */
93
94     int nrefs;                  /*!< Reference count. */
95 };
96
97 #endif /* _RPMTS_INTERNAL_H */