23#ifndef LIBDPKG_DPKG_DB_H
24#define LIBDPKG_DPKG_DB_H
wdb_must_sync
Must sync the written file.
Definition dpkg-db.h:478
pdb_close_fd
Close file descriptor on context destruction.
Definition dpkg-db.h:363
pdb_lax_version_parser
Perform laxer version parsing.
Definition dpkg-db.h:357
pdb_rejectstatus
Throw up an error if ‘Status’ encountered.
Definition dpkg-db.h:349
msdbrw_readonly
Definition dpkg-db.h:278
wdb_dump_available
Dump ‘available’ in-core structures, not ‘status’.
Definition dpkg-db.h:476
pdb_parse_binary
Definition dpkg-db.h:376
pdb_weakclassification
Ignore priority/section info if we already have any.
Definition dpkg-db.h:351
pdb_parse_available
Definition dpkg-db.h:374
CONFFILE_NONE
No flags.
Definition dpkg-db.h:82
wdb_none
No flags.
Definition dpkg-db.h:474
pdb_dash_is_stdin
Interpret filename ‘-’ as stdin.
Definition dpkg-db.h:365
pdb_parse_status
Definition dpkg-db.h:371
pdb_allow_empty
Allow empty/missing files.
Definition dpkg-db.h:367
msdbrw_unset
Definition dpkg-db.h:275
pdb_lax_stanza_parser
Perform laxer control stanza parsing.
Definition dpkg-db.h:359
msdbrw_available_mask
Definition dpkg-db.h:287
msdbrw_needsuperuser
Definition dpkg-db.h:282
pdb_lax_parser
Perform laxer parsing, used to transition to stricter parsing.
Definition dpkg-db.h:361
msdbrw_write
Definition dpkg-db.h:281
msdbrw_available_write
Definition dpkg-db.h:286
msdbrw_writeifposs
Definition dpkg-db.h:280
pdb_single_stanza
Parse a single control stanza.
Definition dpkg-db.h:345
CONFFILE_OBSOLETE
The conffile is not shipped anymore in the new package.
Definition dpkg-db.h:84
pdb_ignore_archives
Ignore archives info if we already have them.
Definition dpkg-db.h:353
pdb_parse_update
Definition dpkg-db.h:373
msdbrw_needsuperuserlockonly
Definition dpkg-db.h:279
msdbrw_available_readonly
Definition dpkg-db.h:285
pdb_recordavailable
Store in ‘available’ in-core structures, not ‘status’.
Definition dpkg-db.h:347
pdb_ignoreolder
Ignore packages with older versions already read.
Definition dpkg-db.h:355
CONFFILE_REMOVE_ON_UPGRADE
The conffile is marked to be removed during package upgrade.
Definition dpkg-db.h:86
struct pkginfo * pkg_hash_find_singleton(const char *name)
Return the singleton package instance with the given name.
Definition pkg-hash.c:146
void copy_dependency_links(struct pkginfo *pkg, struct dependency **updateme, struct dependency *newdepends, bool available)
Copy dependency links structures.
Definition parse.c:877
const char * pkgbin_name_archqual(const struct pkginfo *pkg, const struct pkgbin *pkgbin)
Definition pkg-show.c:86
enum modstatdb_rw modstatdb_open(enum modstatdb_rw reqrwflags)
Definition dbmodify.c:306
void writedb(const char *filename, enum writedb_flags flags)
Definition dump.c:537
int parseversion(struct dpkg_version *version, const char *, struct dpkg_error *err)
Parse a version string and check for invalid syntax.
Definition parsehelp.c:234
enum DPKG_ATTR_ENUM_FLAGS conffile_flags
Definition dpkg-db.h:80
const struct namevalue priorityinfos[]
Definition pkg-namevalue.c:42
bool versionsatisfied(struct pkgbin *it, struct deppossi *against)
Definition depcon.c:31
deptype
Definition dpkg-db.h:44
void modstatdb_note_ifwrite(struct pkginfo *pkg)
Definition dbmodify.c:528
const char * pkgbin_name(struct pkginfo *pkg, struct pkgbin *pkgbin, enum pkg_name_arch_when pnaw)
Return a string representation of the package name.
Definition pkg-show.c:171
const struct namevalue multiarchinfos[]
Definition pkg-namevalue.c:34
versiondisplayepochwhen
Definition dpkg-db.h:406
void pkgset_blank(struct pkgset *set)
Definition pkg.c:149
bool archsatisfied(struct pkgbin *it, struct deppossi *against)
Definition depcon.c:82
const struct namevalue booleaninfos[]
Definition pkg-namevalue.c:28
pkgeflag
Definition dpkg-db.h:174
const char * dpkg_db_set_dir(const char *dir)
Set current on-disk database directory.
Definition dbdir.c:71
const char * versiondescribe_c(const struct dpkg_version *version, enum versiondisplayepochwhen vdew)
Definition parsehelp.c:208
const char * pkg_eflag_name(const struct pkginfo *pkg)
Return a string representation of the package eflag status name.
Definition pkg-show.c:322
const char * pkg_want_name(const struct pkginfo *pkg)
Return a string representation of the package want status name.
Definition pkg-show.c:309
void modstatdb_lock(void)
Definition dbmodify.c:280
enum modstatdb_rw modstatdb_get_status(void)
Definition dbmodify.c:376
pkgmultiarch
Definition dpkg-db.h:104
void nffreeall(void)
Definition nfmalloc.c:74
pkgpriority
Definition dpkg-db.h:190
pkgwant
Definition dpkg-db.h:164
const char * dpkg_db_get_dir(void)
Get current on-disk database directory.
Definition dbdir.c:95
const char * pkg_name(struct pkginfo *pkg, enum pkg_name_arch_when pnaw)
Return a string representation of the installed package name.
Definition pkg-show.c:195
bool modstatdb_can_lock(void)
Definition dbmodify.c:249
enum DPKG_ATTR_ENUM_FLAGS writedb_flags
Definition dpkg-db.h:472
void varbuf_stanza(struct varbuf *, const struct pkginfo *, const struct pkgbin *)
Definition dump.c:466
char * nfstrsave(const char *)
Definition nfmalloc.c:58
bool pkg_virtual_deppossi_satisfied(struct deppossi *dependee, struct deppossi *provider)
Check if the dependency is satisfied by a virtual package.
Definition depcon.c:111
void varbufdependency(struct varbuf *vb, struct dependency *dep)
Definition dump.c:305
int pkgset_installed_instances(struct pkgset *set)
Get the number of installed package instances in a package set.
Definition pkg.c:182
char * dpkg_db_get_path(const char *pathpart)
Get a pathname to the current on-disk database directory.
Definition dbdir.c:114
void pkg_hash_reset(void)
Definition pkg-hash.c:365
pkgstatus
Definition dpkg-db.h:179
void pkg_blank(struct pkginfo *pp)
Definition pkg.c:117
const char * pkgbin_name_const(const struct pkginfo *pkg, const struct pkgbin *pkgbin, enum pkg_name_arch_when pnaw)
Return a string representation of the package name.
Definition pkg-show.c:123
const char * pkg_name_is_illegal(const char *p)
Definition parsehelp.c:140
struct pkginfo * pkg_hash_find_pkg(const char *name, const struct dpkg_arch *arch)
Return the package instance with the given name and architecture.
Definition pkg-hash.c:228
void pkg_hash_report(FILE *)
Definition pkg-hash.c:375
bool pkg_is_informative(struct pkginfo *pkg, struct pkgbin *info)
Check if a pkg is informative.
Definition pkg.c:194
void pkg_source_version(struct dpkg_version *version, const struct pkginfo *pkg, const struct pkgbin *pkgbin)
Definition pkg-show.c:415
void varbufversion(struct varbuf *, const struct dpkg_version *, enum versiondisplayepochwhen)
Definition parsehelp.c:162
const char * versiondescribe(const struct dpkg_version *, enum versiondisplayepochwhen)
Definition parsehelp.c:189
void writedb_stanzas(FILE *fp, const char *filename, enum writedb_flags flags)
Definition dump.c:496
int pkg_hash_count_set(void)
Return the number of package sets available in the database.
Definition pkg-hash.c:245
int parsedb(const char *filename, enum parsedbflags, struct pkginfo **donep)
Parse a deb822 style file.
Definition parse.c:841
const struct arbitraryfield * find_arbfield_info(const struct arbitraryfield *arbs, const char *fieldname)
Definition parsehelp.c:128
const struct namevalue statusinfos[]
Definition pkg-namevalue.c:67
void * nfmalloc(size_t)
Definition nfmalloc.c:50
const struct fieldinfo * find_field_info(const struct fieldinfo *fields, const char *fieldname)
Definition parsehelp.c:116
const struct namevalue wantinfos[]
Definition pkg-namevalue.c:52
void varbuf_add_pkgbin_name(struct varbuf *vb, const struct pkginfo *pkg, const struct pkgbin *pkgbin, enum pkg_name_arch_when pnaw)
Add a string representation of the package name to a varbuf.
Definition pkg-show.c:76
struct pkg_hash_iter * pkg_hash_iter_new(void)
Create a new package iterator.
Definition pkg-hash.c:274
void modstatdb_init(void)
Definition dbmodify.c:181
int pkg_hash_count_pkg(void)
Return the number of package instances available in the database.
Definition pkg-hash.c:256
const char * pkg_priority_name(const struct pkginfo *pkg)
Return a string representation of the package priority name.
Definition pkg-show.c:348
void modstatdb_shutdown(void)
Definition dbmodify.c:407
void write_stanza(FILE *, const char *, const struct pkginfo *, const struct pkgbin *)
Definition dump.c:481
void pkgbin_blank(struct pkgbin *pkgbin)
Definition pkg.c:99
const char * pkg_name_const(const struct pkginfo *pkg, enum pkg_name_arch_when pnaw)
Return a string representation of the installed package name.
Definition pkg-show.c:149
void modstatdb_note(struct pkginfo *pkg)
Definition dbmodify.c:484
void modstatdb_done(void)
Definition dbmodify.c:201
enum DPKG_ATTR_ENUM_FLAGS parsedbflags
Definition dpkg-db.h:343
struct pkgset * pkg_hash_iter_next_set(struct pkg_hash_iter *iter)
Definition pkg-hash.c:295
pkg_name_arch_when
Definition dpkg-db.h:420
enum DPKG_ATTR_ENUM_FLAGS modstatdb_rw
Definition dpkg-db.h:274
struct pkgset * pkg_hash_find_set(const char *name)
Return the package set with the given name.
Definition pkg-hash.c:68
bool modstatdb_is_locked(void)
Definition dbmodify.c:221
struct pkginfo * pkg_hash_get_singleton(struct pkgset *set)
Return the singleton package instance from a package set.
Definition pkg-hash.c:112
bool deparchsatisfied(struct pkgbin *it, const struct dpkg_arch *arch, struct deppossi *against)
Check if the architecture qualifier in the dependency is satisfied.
Definition depcon.c:55
struct pkginfo * pkg_hash_iter_next_pkg(struct pkg_hash_iter *iter)
Definition pkg-hash.c:330
void varbuf_add_source_version(struct varbuf *vb, const struct pkginfo *pkg, const struct pkgbin *pkgbin)
Add a string representation of the source package version to a varbuf.
Definition pkg-show.c:405
void modstatdb_checkpoint(void)
Definition dbmodify.c:381
void pkg_hash_iter_free(struct pkg_hash_iter *iter)
Definition pkg-hash.c:359
struct pkginfo * pkg_hash_get_pkg(struct pkgset *set, const struct dpkg_arch *arch)
Return the package instance in a set with the given architecture.
Definition pkg-hash.c:174
char * nfstrnsave(const char *, size_t)
Definition nfmalloc.c:66
const char * pkg_status_name(const struct pkginfo *pkg)
Return a string representation of the package current status name.
Definition pkg-show.c:335
const struct namevalue eflaginfos[]
Definition pkg-namevalue.c:61
void modstatdb_unlock(void)
Definition dbmodify.c:294
@ dep_depends
Definition dpkg-db.h:47
@ dep_enhances
Definition dpkg-db.h:53
@ dep_conflicts
Definition dpkg-db.h:50
@ dep_replaces
Definition dpkg-db.h:52
@ dep_predepends
Definition dpkg-db.h:48
@ dep_suggests
Definition dpkg-db.h:45
@ dep_recommends
Definition dpkg-db.h:46
@ dep_provides
Definition dpkg-db.h:51
@ dep_breaks
Definition dpkg-db.h:49
@ vdew_nonambig
Definition dpkg-db.h:408
@ vdew_never
Definition dpkg-db.h:407
@ vdew_always
Definition dpkg-db.h:409
@ PKG_EFLAG_REINSTREQ
Definition dpkg-db.h:176
@ PKG_EFLAG_OK
Definition dpkg-db.h:175
@ PKG_MULTIARCH_ALLOWED
Definition dpkg-db.h:107
@ PKG_MULTIARCH_SAME
Definition dpkg-db.h:106
@ PKG_MULTIARCH_FOREIGN
Definition dpkg-db.h:108
@ PKG_MULTIARCH_NO
Definition dpkg-db.h:105
@ PKG_PRIO_EXTRA
Definition dpkg-db.h:195
@ PKG_PRIO_OTHER
Definition dpkg-db.h:196
@ PKG_PRIO_IMPORTANT
Definition dpkg-db.h:192
@ PKG_PRIO_UNSET
Definition dpkg-db.h:198
@ PKG_PRIO_REQUIRED
Definition dpkg-db.h:191
@ PKG_PRIO_OPTIONAL
Definition dpkg-db.h:194
@ PKG_PRIO_UNKNOWN
Definition dpkg-db.h:197
@ PKG_PRIO_STANDARD
Definition dpkg-db.h:193
@ PKG_WANT_PURGE
Definition dpkg-db.h:169
@ PKG_WANT_INSTALL
Definition dpkg-db.h:166
@ PKG_WANT_UNKNOWN
Definition dpkg-db.h:165
@ PKG_WANT_SENTINEL
Not allowed except as special sentinel value in some places.
Definition dpkg-db.h:171
@ PKG_WANT_HOLD
Definition dpkg-db.h:167
@ PKG_WANT_DEINSTALL
Definition dpkg-db.h:168
@ PKG_STAT_TRIGGERSPENDING
Definition dpkg-db.h:186
@ PKG_STAT_TRIGGERSAWAITED
Definition dpkg-db.h:185
@ PKG_STAT_CONFIGFILES
Definition dpkg-db.h:181
@ PKG_STAT_NOTINSTALLED
Definition dpkg-db.h:180
@ PKG_STAT_INSTALLED
Definition dpkg-db.h:187
@ PKG_STAT_HALFCONFIGURED
Definition dpkg-db.h:184
@ PKG_STAT_HALFINSTALLED
Definition dpkg-db.h:182
@ PKG_STAT_UNPACKED
Definition dpkg-db.h:183
@ pnaw_same
Display arch only when it's a Multi-Arch same package.
Definition dpkg-db.h:426
@ pnaw_nonambig
Display arch only when it's non-ambiguous.
Definition dpkg-db.h:424
@ pnaw_never
Never display arch.
Definition dpkg-db.h:422
@ pnaw_always
Always display arch.
Definition dpkg-db.h:430
@ pnaw_foreign
Display arch only when it's a foreign one.
Definition dpkg-db.h:428
#define DPKG_ATTR_ENUM_FLAGS
Definition macros.h:149
#define DPKG_BEGIN_DECLS
Definition macros.h:164
#define DPKG_END_DECLS
Definition macros.h:165
#define DPKG_BIT(n)
Return the integer value of bit n.
Definition macros.h:203
void info(const char *fmt,...)
Definition report.c:119
enum DPKG_ATTR_ENUM_FLAGS dpkg_relation
Enum constants for the supported relation operations that can be done on Debian versions.
Definition version.h:64
const char * name
Definition dpkg-db.h:76
const char * value
Definition dpkg-db.h:77
struct arbitraryfield * next
Definition dpkg-db.h:75
struct archivedetails * next
Definition dpkg-db.h:97
const char * name
Definition dpkg-db.h:98
const char * size
Definition dpkg-db.h:100
const char * msdosname
Definition dpkg-db.h:99
const char * md5sum
Definition dpkg-db.h:101
enum conffile_flags flags
Definition dpkg-db.h:93
struct conffile * next
Definition dpkg-db.h:90
const char * name
Definition dpkg-db.h:91
const char * hash
Definition dpkg-db.h:92
enum deptype type
Definition dpkg-db.h:60
struct deppossi * list
Definition dpkg-db.h:59
struct dependency * next
Definition dpkg-db.h:58
struct pkginfo * up
Definition dpkg-db.h:57
struct pkgset * ed
Definition dpkg-db.h:65
struct deppossi * rev_prev
Definition dpkg-db.h:66
struct dependency * up
Definition dpkg-db.h:64
struct deppossi * rev_next
Definition dpkg-db.h:66
bool arch_is_implicit
Definition dpkg-db.h:70
bool cyclebreak
Definition dpkg-db.h:71
const struct dpkg_arch * arch
Definition dpkg-db.h:67
struct deppossi * next
Definition dpkg-db.h:66
struct dpkg_version version
Definition dpkg-db.h:68
enum dpkg_relation verrel
Definition dpkg-db.h:69
Data structure representing a Debian version.
Definition version.h:42
Definition parsedump.h:146
Definition namevalue.h:35
Definition pkg-hash.c:261
Node describing a binary package file.
Definition dpkg-db.h:116
const char * description
Definition dpkg-db.h:127
bool essential
The ‘essential’ flag, true = yes, false = no (absent).
Definition dpkg-db.h:119
struct dependency * depends
Definition dpkg-db.h:117
struct dpkg_version version
Definition dpkg-db.h:133
const char * source
Definition dpkg-db.h:129
const struct dpkg_arch * arch
Definition dpkg-db.h:123
const char * installedsize
Definition dpkg-db.h:130
const char * pkgname_archqual
The following is the "pkgname:archqual" cached string, if this was a C++ class this member would be m...
Definition dpkg-db.h:126
bool is_protected
The ‘protected’ flag, true = yes, false = no (absent).
Definition dpkg-db.h:121
enum pkgmultiarch multiarch
Definition dpkg-db.h:122
struct arbitraryfield * arbs
Definition dpkg-db.h:135
struct conffile * conffiles
Definition dpkg-db.h:134
const char * maintainer
Definition dpkg-db.h:128
const char * bugs
Definition dpkg-db.h:132
const char * origin
Definition dpkg-db.h:131
Node describing an architecture package instance.
Definition dpkg-db.h:206
const char * otherpriority
Definition dpkg-db.h:215
struct trigpend * trigpend_head
Definition dpkg-db.h:231
enum pkgwant want
Definition dpkg-db.h:210
enum pkgstatus status
Definition dpkg-db.h:213
struct pkgbin available
Definition dpkg-db.h:219
const char * section
Definition dpkg-db.h:216
struct trigaw * othertrigaw_head
Definition dpkg-db.h:230
struct pkgbin installed
Definition dpkg-db.h:218
enum pkgpriority priority
Definition dpkg-db.h:214
struct pkginfo::@2 trigaw
struct trigaw * head
Definition dpkg-db.h:226
bool files_list_valid
Definition dpkg-db.h:244
struct fsys_namenode_list * files
files_list_valid files Meaning
Definition dpkg-db.h:242
struct pkgset * set
Definition dpkg-db.h:207
bool status_dirty
Definition dpkg-db.h:247
off_t files_list_phys_offs
Definition dpkg-db.h:243
struct dpkg_version configversion
Definition dpkg-db.h:217
enum pkgeflag eflag
The error flag bitmask.
Definition dpkg-db.h:212
struct archivedetails * archives
Definition dpkg-db.h:222
struct perpackagestate * clientdata
Definition dpkg-db.h:220
struct pkginfo * arch_next
Definition dpkg-db.h:208
Node describing a package set sharing the same package name.
Definition dpkg-db.h:253
struct deppossi * available
Definition dpkg-db.h:258
struct deppossi * installed
Definition dpkg-db.h:259
struct pkginfo pkg
Definition dpkg-db.h:256
const char * name
Definition dpkg-db.h:255
int installed_instances
Definition dpkg-db.h:261
struct pkgset * next
Definition dpkg-db.h:254
struct pkgset::@3 depended
Node indicates that aw's Triggers-Awaited mentions pend.
Definition dpkg-db.h:153
struct trigaw * next
Definition dpkg-db.h:157
struct pkginfo * pend
Definition dpkg-db.h:154
struct trigaw * samepend_next
Definition dpkg-db.h:155
struct pkginfo * aw
Definition dpkg-db.h:154
struct trigaw * prev
Definition dpkg-db.h:157
Node indicates that parent's Triggers-Pending mentions name.
Definition dpkg-db.h:145
struct trigpend * next
Definition dpkg-db.h:146
const char * name
Definition dpkg-db.h:147
varbuf_init must be called exactly once before the use of each varbuf (including before any call to v...
Definition varbuf.h:56
struct trigfileint * tail
Definition triglib.c:413