117
125
struct arbitraryfield *arbs;
129
* Node indicates that parent's Triggers-Pending mentions name.
131
* Note: These nodes do double duty: after they're removed from a package's
132
* trigpend list, references may be preserved by the trigger cycle checker
120
135
struct trigpend {
121
/* Node indicates that parent's Triggers-Pending mentions name. */
122
/* NB that these nodes do double duty: after they're removed from
123
* a package's trigpend list, references may be preserved by the
124
* trigger cycle checker (see trigproc.c).
126
136
struct trigpend *next;
127
137
const char *name;
141
* Node indicates that aw's Triggers-Awaited mentions pend.
131
/* Node indicates that aw's Triggers-Awaited mentions pend. */
132
144
struct pkginfo *aw, *pend;
133
145
struct trigaw *samepend_next;
139
struct perpackagestate; /* dselect and dpkg have different versions of this */
151
/* Note: dselect and dpkg have different versions of this. */
152
struct perpackagestate;
141
struct pkginfo { /* pig */
155
* Node describing an architecture package instance.
157
* This structure holds state information.
159
* Note: Usually referred in the code as pig.
142
162
struct pkginfo *next;
143
163
const char *name;
145
165
want_unknown, want_install, want_hold, want_deinstall, want_purge,
146
want_sentinel /* Not allowed except as special sentinel value
166
/* Not allowed except as special sentinel value in some places. */
169
/* The error flag bitmask. */
151
172
eflag_reinstreq = 1,
152
} eflag; /* Bitmask. */
154
175
stat_notinstalled,
155
176
stat_configfiles,
193
220
msdbrw_readonly/*s*/, msdbrw_needsuperuserlockonly/*s*/,
194
221
msdbrw_writeifposs,
195
222
msdbrw_write/*s*/, msdbrw_needsuperuser,
196
224
/* Now some optional flags: */
197
msdbrw_flagsmask= ~077,
198
/* flags start at 0100 */
199
msdbrw_noavail= 0100,
225
msdbrw_available_mask= ~077,
226
/* Flags start at 0100. */
227
msdbrw_available_readonly = 0100,
228
msdbrw_available_write = 0200,
202
bool modstatdb_is_locked(const char *admindir);
203
void modstatdb_lock(const char *admindir);
231
void modstatdb_init(void);
232
void modstatdb_done(void);
233
bool modstatdb_is_locked(void);
234
bool modstatdb_can_lock(void);
235
void modstatdb_lock(void);
204
236
void modstatdb_unlock(void);
205
enum modstatdb_rw modstatdb_init(const char *admindir, enum modstatdb_rw reqrwflags);
237
enum modstatdb_rw modstatdb_open(enum modstatdb_rw reqrwflags);
206
238
void modstatdb_note(struct pkginfo *pkg);
207
239
void modstatdb_note_ifwrite(struct pkginfo *pkg);
208
240
void modstatdb_checkpoint(void);
209
241
void modstatdb_shutdown(void);
211
const char *pkgadmindir(void);
212
const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile);
214
243
/*** from database.c ***/
216
struct pkginfo *findpackage(const char *name);
217
void blankpackage(struct pkginfo *pp);
218
void blankpackageperfile(struct pkginfoperfile *pifp);
245
void pkg_blank(struct pkginfo *pp);
246
void pkgbin_blank(struct pkgbin *pifp);
219
247
void blankversion(struct versionrevision*);
220
bool informative(struct pkginfo *pkg, struct pkginfoperfile *info);
221
int countpackages(void);
222
void resetpackages(void);
224
struct pkgiterator *iterpkgstart(void);
225
struct pkginfo *iterpkgnext(struct pkgiterator*);
226
void iterpkgend(struct pkgiterator*);
228
void hashreport(FILE*);
248
bool pkg_is_informative(struct pkginfo *pkg, struct pkgbin *info);
250
struct pkginfo *pkg_db_find(const char *name);
251
int pkg_db_count(void);
252
void pkg_db_reset(void);
254
struct pkgiterator *pkg_db_iter_new(void);
255
struct pkginfo *pkg_db_iter_next(struct pkgiterator *iter);
256
void pkg_db_iter_free(struct pkgiterator *iter);
258
void pkg_db_report(FILE *);
230
260
/*** from parse.c ***/
232
262
enum parsedbflags {
233
pdb_recordavailable =001, /* Store in `available' in-core structures, not `status' */
234
pdb_rejectstatus =002, /* Throw up an error if `Status' encountered */
235
pdb_weakclassification=004, /* Ignore priority/section info if we already have any */
236
pdb_ignorefiles =010, /* Ignore files info if we already have them */
263
/* Store in ‘available’ in-core structures, not ‘status’. */
264
pdb_recordavailable = 001,
265
/* Throw up an error if ‘Status’ encountered. */
266
pdb_rejectstatus = 002,
267
/* Ignore priority/section info if we already have any. */
268
pdb_weakclassification = 004,
269
/* Ignore files info if we already have them. */
270
pdb_ignorefiles = 010,
237
271
/* Ignore packages with older versions already read. */
238
pdb_ignoreolder =020,
272
pdb_ignoreolder = 020,
239
273
/* Perform laxer parsing, used to transition to stricter parsing. */
274
pdb_lax_parser = 040,
243
const char *illegal_packagename(const char *p, const char **ep);
244
int parsedb(const char *filename, enum parsedbflags, struct pkginfo **donep,
245
FILE *warnto, int *warncount);
277
const char *pkg_name_is_illegal(const char *p, const char **ep);
278
int parsedb(const char *filename, enum parsedbflags, struct pkginfo **donep);
246
279
void copy_dependency_links(struct pkginfo *pkg,
247
280
struct dependency **updateme,
248
281
struct dependency *newdepends,
273
303
/*** from dump.c ***/
275
305
void writerecord(FILE*, const char*,
276
const struct pkginfo*, const struct pkginfoperfile*);
306
const struct pkginfo *, const struct pkgbin *);
278
308
void writedb(const char *filename, bool available, bool mustsync);
280
void varbufrecord(struct varbuf*, const struct pkginfo*, const struct pkginfoperfile*);
310
/* Note: The varbufs must have been initialized and will not be
312
void varbufrecord(struct varbuf *, const struct pkginfo *,
313
const struct pkgbin *);
281
314
void varbufdependency(struct varbuf *vb, struct dependency *dep);
282
/* NB THE VARBUF MUST HAVE BEEN INITIALISED AND WILL NOT BE NULL-TERMINATED */
284
316
/*** from vercmp.c ***/
286
bool versionsatisfied(struct pkginfoperfile *it, struct deppossi *against);
318
bool versionsatisfied(struct pkgbin *it, struct deppossi *against);
287
319
bool versionsatisfied3(const struct versionrevision *it,
288
320
const struct versionrevision *ref,
289
321
enum depverrel verrel);