diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dpkg/dpkg-db.h | 82 | ||||
-rw-r--r-- | lib/dpkg/error.h | 14 | ||||
-rw-r--r-- | lib/dpkg/pkg-spec.h | 22 |
3 files changed, 69 insertions, 49 deletions
diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h index fb9eaf767..96f1222e4 100644 --- a/lib/dpkg/dpkg-db.h +++ b/lib/dpkg/dpkg-db.h @@ -92,6 +92,13 @@ struct filedetails { const char *md5sum; }; +enum pkgmultiarch { + multiarch_no, + multiarch_same, + multiarch_allowed, + multiarch_foreign, +}; + /** * Node describing a binary package file. * @@ -101,12 +108,7 @@ struct pkgbin { struct dependency *depends; /** The ‘essential’ flag, true = yes, false = no (absent). */ bool essential; - enum pkgmultiarch { - multiarch_no, - multiarch_same, - multiarch_allowed, - multiarch_foreign, - } multiarch; + enum pkgmultiarch multiarch; const struct dpkg_arch *arch; /** The following is the "pkgname:archqual" cached string, if this was a * C++ class this member would be mutable. */ @@ -148,6 +150,43 @@ struct trigaw { /* Note: dselect and dpkg have different versions of this. */ struct perpackagestate; +enum pkgwant { + want_unknown, + want_install, + want_hold, + want_deinstall, + want_purge, + /** Not allowed except as special sentinel value in some places. */ + want_sentinel, +}; + +enum pkgeflag { + eflag_ok = 0, + eflag_reinstreq = 1, +}; + +enum pkgstatus { + stat_notinstalled, + stat_configfiles, + stat_halfinstalled, + stat_unpacked, + stat_halfconfigured, + stat_triggersawaited, + stat_triggerspending, + stat_installed, +}; + +enum pkgpriority { + pri_required, + pri_important, + pri_standard, + pri_optional, + pri_extra, + pri_other, + pri_unknown, + pri_unset = -1, +}; + /** * Node describing an architecture package instance. * @@ -157,34 +196,11 @@ struct pkginfo { struct pkgset *set; struct pkginfo *arch_next; - enum pkgwant { - want_unknown, want_install, want_hold, want_deinstall, want_purge, - /** Not allowed except as special sentinel value in some places. */ - want_sentinel, - } want; + enum pkgwant want; /** The error flag bitmask. */ - enum pkgeflag { - eflag_ok = 0, - eflag_reinstreq = 1, - } eflag; - enum pkgstatus { - stat_notinstalled, - stat_configfiles, - stat_halfinstalled, - stat_unpacked, - stat_halfconfigured, - stat_triggersawaited, - stat_triggerspending, - stat_installed - } status; - enum pkgpriority { - pri_required, - pri_important, - pri_standard, - pri_optional, - pri_extra, - pri_other, pri_unknown, pri_unset=-1 - } priority; + enum pkgeflag eflag; + enum pkgstatus status; + enum pkgpriority priority; const char *otherpriority; const char *section; struct dpkg_version configversion; diff --git a/lib/dpkg/error.h b/lib/dpkg/error.h index e38823cd8..08555dc85 100644 --- a/lib/dpkg/error.h +++ b/lib/dpkg/error.h @@ -2,7 +2,7 @@ * libdpkg - Debian packaging suite library routines * error.h - error message reporting * - * Copyright © 2011-2012 Guillem Jover <guillem@debian.org> + * Copyright © 2011-2014 Guillem Jover <guillem@debian.org> * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,12 +31,14 @@ DPKG_BEGIN_DECLS * @{ */ +enum dpkg_msg_type { + DPKG_MSG_NONE, + DPKG_MSG_WARN, + DPKG_MSG_ERROR, +}; + struct dpkg_error { - enum dpkg_msg_type { - DPKG_MSG_NONE, - DPKG_MSG_WARN, - DPKG_MSG_ERROR, - } type; + enum dpkg_msg_type type; char *str; }; diff --git a/lib/dpkg/pkg-spec.h b/lib/dpkg/pkg-spec.h index 25f9a8992..1b4a96b8c 100644 --- a/lib/dpkg/pkg-spec.h +++ b/lib/dpkg/pkg-spec.h @@ -4,7 +4,7 @@ * * Copyright © 2011 Linaro Limited * Copyright © 2011 Raphaël Hertzog <hertzog@debian.org> - * Copyright © 2011-2012 Guillem Jover <guillem@debian.org> + * Copyright © 2011-2014 Guillem Jover <guillem@debian.org> * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,19 +38,21 @@ DPKG_BEGIN_DECLS * @{ */ +enum pkg_spec_flags { + /** Recognize glob patterns. */ + psf_patterns = DPKG_BIT(0), + + /* How to consider the lack of an arch qualifier. */ + psf_arch_def_single = DPKG_BIT(8), + psf_arch_def_wildcard = DPKG_BIT(9), + psf_arch_def_mask = 0xff00, +}; + struct pkg_spec { char *name; const struct dpkg_arch *arch; - enum pkg_spec_flags { - /** Recognize glob patterns. */ - psf_patterns = DPKG_BIT(0), - - /* How to consider the lack of an arch qualifier. */ - psf_arch_def_single = DPKG_BIT(8), - psf_arch_def_wildcard = DPKG_BIT(9), - psf_arch_def_mask = 0xff00, - } flags; + enum pkg_spec_flags flags; /* Members below are private state. */ |