1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
|
#ifndef H_RPMAL
#define H_RPMAL
/** \ingroup rpmdep rpmtrans
* \file lib/rpmal.h
* Structures used for managing added/available package lists.
*/
/**
*/
typedef /*@abstract@*/ struct tsortInfo_s * tsortInfo;
/** \ingroup rpmdep
* Dependncy ordering information.
*/
/*@-fielduse@*/ /* LCL: confused by union? */
struct tsortInfo_s {
union {
int count;
/*@kept@*/ /*@null@*/ availablePackage suc;
} tsi_u;
#define tsi_count tsi_u.count
#define tsi_suc tsi_u.suc
/*@owned@*/ /*@null@*/
struct tsortInfo_s * tsi_next;
/*@kept@*/ /*@null@*/
availablePackage tsi_pkg;
int tsi_reqx;
int tsi_qcnt;
};
/*@=fielduse@*/
/** \ingroup rpmdep
* Info about a single package to be installed.
*/
struct availablePackage_s {
Header h; /*!< Package header. */
/*@dependent@*/ const char * name; /*!< Header name. */
/*@dependent@*/ const char * version; /*!< Header version. */
/*@dependent@*/ const char * release; /*!< Header release. */
struct rpmDepSet_s provides; /*!< Provides: dependencies. */
struct rpmDepSet_s requires; /*!< Requires: dependencies. */
/*@owned@*//*@null@*/ const char ** baseNames; /*!< Header file basenames. */
/*@dependent@*//*@null@*/ int_32 * epoch; /*!< Header epoch (if any). */
int filesCount; /*!< No. of files in header. */
int npreds; /*!< No. of predecessors. */
int depth; /*!< Max. depth in dependency tree. */
struct tsortInfo_s tsi; /*!< Dependency tsort data. */
uint_32 multiLib; /* MULTILIB */
/*@kept@*//*@null@*/ const void * key; /*!< Private data associated with a package (e.g. file name of package). */
/*@null@*/ rpmRelocation * relocs;
/*@null@*/ FD_t fd;
};
#ifdef __cplusplus
extern "C" {
#endif
/**
* Return number of packages in list.
* @param al available list
* @return no. of packages in list
*/
int alGetSize(const availableList al)
/*@*/;
/**
* Return available package key.
* @param al available list
* @param pkgNum available package index
* @return available package key
*/
/*@kept@*/ /*@null@*/
const void * alGetKey(/*@null@*/ const availableList al, int pkgNum)
/*@*/;
/**
* Return available package multiLib flag.
* @param al available list
* @param pkgNum available package index
* @return available package multiLib flag
*/
int alGetMultiLib(/*@null@*/ const availableList al, int pkgNum)
/*@*/;
/**
* Return available package files count.
* @param al available list
* @param pkgNum available package index
* @return available package files count
*/
int alGetFilesCount(/*@null@*/ const availableList al, int pkgNum)
/*@*/;
/**
* Return available package provides.
* @param al available list
* @param pkgNum available package index
* @return available package provides
*/
rpmDepSet alGetProvides(/*@null@*/ const availableList al, int pkgNum)
/*@*/;
/**
* Return available package requires.
* @param al available list
* @param pkgNum available package index
* @return available package requires
*/
rpmDepSet alGetRequires(/*@null@*/ const availableList al, int pkgNum)
/*@*/;
/**
* Return available package tsort info.
* @param al available list
* @param pkgNum available package index
* @return available package tsort info
*/
tsortInfo alGetTSI(/*@null@*/ const availableList al, int pkgNum)
/*@*/;
/**
* Return available package header.
* @param al available list
* @param pkgNum available package index
* @param unlink Should alp->h be unlinked?
* @return available package header
*/
Header alGetHeader(/*@null@*/ availableList al, int pkgNum, int unlink)
/*@modifies al @*/;
/**
* Return available package relocations.
* @warning alp->relocs set to NULL after call.
* @param al available list
* @param pkgNum available package index
* @return available package relocations
*/
/*@null@*/
rpmRelocation * alGetRelocs(/*@null@*/ availableList al, int pkgNum)
/*@modifies al @*/;
/**
* Return available package file handle.
* @warning alp->fd set to NULL after call.
* @param al available list
* @param pkgNum available package index
* @return available package file handle
*/
/*@null@*/
FD_t alGetFd(/*@null@*/ availableList al, int pkgNum)
/*@modifies al @*/;
/**
* Return available package.
* @param al available list
* @param pkgNum available package index
* @return available package pointer
*/
/*@dependent@*/ /*@null@*/
availablePackage alGetPkg(/*@null@*/ availableList al, int pkgNum)
/*@*/;
/**
* Return available package index.
* @param al available list
* @param alp available package pointer
* @return available package index, -1 on failure
*/
int alGetPkgIndex(/*@null@*/ const availableList al, const availablePackage alp)
/*@*/;
/**
* Return (malloc'd) available package name-version-release string.
* @param al available list
* @param pkgNum available package index
* @return name-version-release string
*/
/*@only@*/ /*@null@*/
char * alGetNVR(/*@null@*/const availableList al, int pkgNum)
/*@*/;
#ifdef DYING
/**
* Append available package problem to set.
*/
/*@unused@*/
void alProblemSetAppend(const availableList al, const availablePackage alp,
rpmProblemSet tsprobs, rpmProblemType type,
const char * dn, const char * bn,
/*@only@*/ /*@null@*/ const char * altNEVR,
unsigned long ulong1)
/*@modifies tsprobs @*/;
#endif
/**
* Initialize available packckages, items, and directory list.
* @param delta no. of entries to add on each realloc
* @return al new available list
*/
/*@only@*/
availableList alCreate(int delta)
/*@*/;
/**
* Free available packages, items, and directory members.
* @param al available list
* @return NULL always
*/
/*@null@*/
availableList alFree(/*@only@*/ /*@null@*/ availableList al)
/*@modifies al @*/;
/**
* Delete package from available list.
* @param al available list
* @param pkgNnum package index
*/
/*@-exportlocal@*/
void alDelPackage(availableList al, int pkgNum)
/*@modifies al @*/;
/*@=exportlocal@*/
/**
* Add package to available list.
* @param al available list
* @param pkgNnum package index, < 0 to force an append
* @param h package header
* @param key package private data
* @param fd package file handle
* @param relocs package file relocations
* @return available package pointer
*/
/*@exposed@*/
availablePackage alAddPackage(availableList al, int pkgNum,
Header h, /*@null@*/ /*@dependent@*/ const void * key,
/*@null@*/ FD_t fd, /*@null@*/ rpmRelocation * relocs)
/*@modifies al, h @*/;
/**
* Generate index for available list.
* @param al available list
*/
void alMakeIndex(availableList al)
/*@modifies al @*/;
/**
* Check added package file lists for package(s) that provide a file.
* @param al available list
* @param keyType type of dependency
* @param fileName file name to search for
* @return available package pointer
*/
/*@-exportlocal@*/
/*@only@*/ /*@null@*/
availablePackage * alAllFileSatisfiesDepend(const availableList al,
const char * keyType, const char * fileName)
/*@*/;
/*@=exportlocal@*/
/**
* Check added package file lists for package(s) that have a provide.
* @param al available list
* @param keyType type of dependency
* @param keyDepend dependency string representation
* @param key dependency
* @return available package pointer
*/
/*@only@*/ /*@null@*/
availablePackage * alAllSatisfiesDepend(const availableList al,
const char * keyType, const char * keyDepend,
const rpmDepSet key)
/*@*/;
/**
* Check added package file lists for first package that has a provide.
* @todo Eliminate.
* @param al available list
* @param keyType type of dependency
* @param keyDepend dependency string representation
* @param key dependency
* @return available package pointer
*/
/*@only@*/ /*@null@*/
availablePackage alSatisfiesDepend(const availableList al,
const char * keyType, const char * keyDepend,
const rpmDepSet key)
/*@*/;
#ifdef __cplusplus
}
#endif
#endif /* H_RPMAL */
|