summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2014-06-02 00:32:45 +0200
committerGuillem Jover <guillem@debian.org>2014-06-02 00:32:45 +0200
commitc7ad73d0a95ed527e1efe013b97cf849f3af55e9 (patch)
tree5488444f937653c8ce00cccf0dcff6903e0169dc /src
parentdc2edadf0bcb624eafbcd16c92aae7691180f7a4 (diff)
downloaddpkg-c7ad73d0a95ed527e1efe013b97cf849f3af55e9.tar.gz
Move enum definitions out of structs
This untangles the types, and makes it possible to use functions that use such enums as arguments from C++ code, as otherwise the enum would need to be declared within the struct namespace.
Diffstat (limited to 'src')
-rw-r--r--src/filesdb.h42
-rw-r--r--src/main.h24
2 files changed, 38 insertions, 28 deletions
diff --git a/src/filesdb.h b/src/filesdb.h
index 80f102ec5..051910a06 100644
--- a/src/filesdb.h
+++ b/src/filesdb.h
@@ -56,6 +56,27 @@ enum fnnflags {
fnn_nonew = DPKG_BIT(1),
};
+enum filenamenode_flags {
+ /** In the newconffiles list. */
+ fnnf_new_conff = DPKG_BIT(0),
+ /** In the new filesystem archive. */
+ fnnf_new_inarchive = DPKG_BIT(1),
+ /** In the old package's conffiles list. */
+ fnnf_old_conff = DPKG_BIT(2),
+ /** Obsolete conffile. */
+ fnnf_obs_conff = DPKG_BIT(3),
+ /** Must remove from other packages' lists. */
+ fnnf_elide_other_lists = DPKG_BIT(4),
+ /** >= 1 instance is a dir, cannot rename over. */
+ fnnf_no_atomic_overwrite = DPKG_BIT(5),
+ /** New file has been placed on the disk. */
+ fnnf_placed_on_disk = DPKG_BIT(6),
+ fnnf_deferred_fsync = DPKG_BIT(7),
+ fnnf_deferred_rename = DPKG_BIT(8),
+ /** Path being filtered. */
+ fnnf_filtered = DPKG_BIT(9),
+};
+
struct filenamenode {
struct filenamenode *next;
const char *name;
@@ -75,26 +96,7 @@ struct filenamenode {
*/
/** Set to zero when a new node is created. */
- enum filenamenode_flags {
- /** In the newconffiles list. */
- fnnf_new_conff = DPKG_BIT(0),
- /** In the new filesystem archive. */
- fnnf_new_inarchive = DPKG_BIT(1),
- /** In the old package's conffiles list. */
- fnnf_old_conff = DPKG_BIT(2),
- /** Obsolete conffile. */
- fnnf_obs_conff = DPKG_BIT(3),
- /** Must remove from other packages' lists. */
- fnnf_elide_other_lists = DPKG_BIT(4),
- /** >= 1 instance is a dir, cannot rename over. */
- fnnf_no_atomic_overwrite = DPKG_BIT(5),
- /** New file has been placed on the disk. */
- fnnf_placed_on_disk = DPKG_BIT(6),
- fnnf_deferred_fsync = DPKG_BIT(7),
- fnnf_deferred_rename = DPKG_BIT(8),
- /** Path being filtered. */
- fnnf_filtered = DPKG_BIT(9),
- } flags;
+ enum filenamenode_flags flags;
/** Valid iff this namenode is in the newconffiles list. */
const char *oldhash;
diff --git a/src/main.h b/src/main.h
index 53f16f529..735af9e55 100644
--- a/src/main.h
+++ b/src/main.h
@@ -29,17 +29,25 @@
struct fileinlist;
struct filenamenode;
+enum istobes {
+ itb_normal,
+ itb_remove,
+ itb_installnew,
+ itb_deconfigure,
+ itb_preinstall
+};
+
+enum pkg_cycle_color {
+ white,
+ gray,
+ black,
+};
+
struct perpackagestate {
- enum istobes {
- itb_normal, itb_remove, itb_installnew, itb_deconfigure, itb_preinstall
- } istobe;
+ enum istobe istobe;
/** Used during cycle detection. */
- enum pkg_cycle_color {
- white,
- gray,
- black,
- } color;
+ enum pkg_cycle_color color;
/**
* filelistvalid files Meaning