Yank rpmfi state update out of rpmtsRun()
[platform/upstream/rpm.git] / lib / rpmfi_internal.h
1 #ifndef _RPMFI_INTERNAL_H
2 #define _RPMFI_INTERNAL_H
3
4 #include <rpm/header.h>
5 #include <rpm/rpmfi.h>
6 #include "lib/fsm.h"            /* for FSM_t */
7
8 /**
9  */
10 typedef struct sharedFileInfo_s *               sharedFileInfo;
11
12 /**
13  */
14 struct sharedFileInfo_s {
15     int pkgFileNum;
16     int otherFileNum;
17     int otherPkg;
18     int isRemoved;
19 };
20
21 /**
22  * A package filename set.
23  */
24 struct rpmfi_s {
25     int i;                      /*!< Current file index. */
26     int j;                      /*!< Current directory index. */
27
28     const char * Type;          /*!< Tag name. */
29
30     rpmTag tagN;                /*!< Header tag. */
31     Header h;                   /*!< Header for file info set (or NULL) */
32
33 /*?null?*/
34     const char ** bnl;          /*!< Base name(s) (from header) */
35 /*?null?*/
36     const char ** dnl;          /*!< Directory name(s) (from header) */
37
38     const char ** flinks;       /*!< File link(s) (from header) */
39     const char ** flangs;       /*!< File lang(s) (from header) */
40
41           uint32_t * dil;       /*!< Directory indice(s) (from header) */
42 /*?null?*/
43     const rpm_flag_t * fflags;  /*!< File flag(s) (from header) */
44 /*?null?*/
45     const rpm_off_t * fsizes;   /*!< File size(s) (from header) */
46 /*?null?*/
47     const rpm_time_t * fmtimes; /*!< File modification time(s) (from header) */
48 /*?null?*/
49           rpm_mode_t * fmodes;  /*!< File mode(s) (from header) */
50 /*?null?*/
51     const rpm_rdev_t * frdevs;  /*!< File rdev(s) (from header) */
52 /*?null?*/
53     const rpm_ino_t * finodes;  /*!< File inodes(s) (from header) */
54
55     const char ** fuser;        /*!< File owner(s) (from header) */
56     const char ** fgroup;       /*!< File group(s) (from header) */
57
58     char * fstates;             /*!< File state(s) (from header) */
59
60     const rpm_color_t * fcolors;/*!< File color bits (header) */
61
62     const char ** fcontexts;    /*! FIle security contexts. */
63
64     const char ** fcaps;        /*! File capabilities (header) */
65
66     const char ** cdict;        /*!< File class dictionary (header) */
67     rpm_count_t ncdict;         /*!< No. of class entries. */
68     const uint32_t * fcdictx;   /*!< File class dictionary index (header) */
69
70     const uint32_t * ddict;     /*!< File depends dictionary (header) */
71     rpm_count_t nddict;         /*!< No. of depends entries. */
72     const uint32_t * fddictx;   /*!< File depends dictionary start (header) */
73     const uint32_t * fddictn;   /*!< File depends dictionary count (header) */
74
75 /*?null?*/
76     const rpm_flag_t * vflags;  /*!< File verify flag(s) (from header) */
77
78     rpm_count_t dc;             /*!< No. of directories. */
79     rpm_count_t fc;             /*!< No. of files. */
80
81 /*=============================*/
82     rpmte te;
83
84     headerGetFlags scareFlags;  /*!< headerGet flags wrt scareMem */
85 /*-----------------------------*/
86     rpmfileAttrs flags;         /*!< File flags (default). */
87     rpmFileAction action;       /*!< File disposition (default). */
88     rpmFileAction * actions;    /*!< File disposition(s). */
89     struct fingerPrint_s * fps; /*!< File fingerprint(s). */
90
91     pgpHashAlgo digestalgo;     /*!< File checksum algorithm */
92     unsigned char * digests;    /*!< File checksums in binary. */
93
94 #define RPMFI_HAVE_PRETRANS     (1 << 0)
95 #define RPMFI_HAVE_POSTTRANS    (1 << 1)
96     int transscripts;           /*!< pre/posttrans script existence */
97
98     char * fn;                  /*!< File name buffer. */
99
100     size_t astriplen;
101     size_t striplen;
102     rpm_loff_t archiveSize;
103     const char ** apath;
104     FSM_t fsm;                  /*!< File state machine data. */
105     int keep_header;            /*!< Keep header? */
106     sharedFileInfo replaced;    /*!< (TR_ADDED) */
107     rpm_off_t * replacedSizes;  /*!< (TR_ADDED) */
108     unsigned int record;        /*!< (TR_REMOVED) */
109     int magic;
110 #define RPMFIMAGIC      0x09697923
111 /*=============================*/
112
113 int nrefs;              /*!< Reference count. */
114 };
115
116 RPM_GNUC_INTERNAL
117 rpmfi rpmfiUpdateState(rpmfi fi, rpmts ts, rpmte p);
118
119 #endif  /* _RPMFI_INTERNAL_H */
120