summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-09-21 11:10:14 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-09-21 11:10:14 +0300
commit2fb15a5443c6a1461a53309d3d4ace598996d8b2 (patch)
tree0ff55a624360ff16a554c801be4873164d1bf226
parentb9168b67355d2da8f62f880adfce37c0e38720d1 (diff)
downloadrpm-2fb15a5443c6a1461a53309d3d4ace598996d8b2.tar.gz
rpm-2fb15a5443c6a1461a53309d3d4ace598996d8b2.tar.bz2
rpm-2fb15a5443c6a1461a53309d3d4ace598996d8b2.zip
Stop abusing enum typedefs for bitfield types
- Enums are fine for defining the bitfield flags, but the bitfield itself is not an enumeration. Add a separate typedef on "rpmFlags" type (presenting a bitfield of flags) for all of these. Compilers hardly care, but the typedefs give a nice visual clue for us humans using these flags far away from ho^H^H definitions.
-rw-r--r--build/files.c6
-rw-r--r--build/rpmbuild.h12
-rw-r--r--build/rpmfc.h2
-rw-r--r--build/rpmspec.h12
-rw-r--r--lib/fsm.h5
-rw-r--r--lib/header.c6
-rw-r--r--lib/header.h12
-rw-r--r--lib/rpmcli.h18
-rw-r--r--lib/rpmds.h6
-rw-r--r--lib/rpmfi.h12
-rw-r--r--lib/rpmgi.h6
-rw-r--r--lib/rpmplugins.h6
-rw-r--r--lib/rpmpol.h8
-rw-r--r--lib/rpmprob.h6
-rw-r--r--lib/rpmscript.h6
-rw-r--r--lib/rpmtag.h6
-rw-r--r--lib/rpmtd.h6
-rw-r--r--lib/rpmts.h12
-rw-r--r--lib/rpmtypes.h2
-rw-r--r--lib/rpmvf.h13
-rw-r--r--lib/tagexts.c5
-rw-r--r--rpmio/argv.h7
-rw-r--r--rpmio/rpmpgp.h6
23 files changed, 121 insertions, 59 deletions
diff --git a/build/files.c b/build/files.c
index e8c9f5043..d74542983 100644
--- a/build/files.c
+++ b/build/files.c
@@ -37,7 +37,7 @@
/**
*/
-typedef enum specdFlags_e {
+enum specdFlags_e {
SPECD_DEFFILEMODE = (1 << 0),
SPECD_DEFDIRMODE = (1 << 1),
SPECD_DEFUID = (1 << 2),
@@ -49,7 +49,9 @@ typedef enum specdFlags_e {
SPECD_UID = (1 << 10),
SPECD_GID = (1 << 11),
SPECD_VERIFY = (1 << 12)
-} specdFlags;
+};
+
+typedef rpmFlags specdFlags;
/**
*/
diff --git a/build/rpmbuild.h b/build/rpmbuild.h
index fcfc9c4cc..adda6e94b 100644
--- a/build/rpmbuild.h
+++ b/build/rpmbuild.h
@@ -17,7 +17,7 @@ extern "C" {
/** \ingroup rpmbuild
* Bit(s) to control rpmSpecBuild() operation.
*/
-typedef enum rpmBuildFlags_e {
+enum rpmBuildFlags_e {
RPMBUILD_NONE = 0,
RPMBUILD_PREP = (1 << 0), /*!< Execute %%prep. */
RPMBUILD_BUILD = (1 << 1), /*!< Execute %%build. */
@@ -33,15 +33,19 @@ typedef enum rpmBuildFlags_e {
RPMBUILD_RMSPEC = (1 << 11), /*!< Remove spec file. */
RPMBUILD_NOBUILD = (1 << 31) /*!< Don't execute or package. */
-} rpmBuildFlags;
+};
+
+typedef rpmFlags rpmBuildFlags;
/** \ingroup rpmbuild
* Bit(s) to control package generation
*/
-typedef enum rpmBuildPkgFlags_e {
+enum rpmBuildPkgFlags_e {
RPMBUILD_PKG_NONE = 0,
RPMBUILD_PKG_NODIRTOKENS = (1 << 0), /*!< Legacy filename layout */
-} rpmBuildPkgFlags;
+};
+
+typedef rpmFlags rpmBuildPkgFlags;
/** \ingroup rpmbuild
* Describe build request.
diff --git a/build/rpmfc.h b/build/rpmfc.h
index 96229640e..986001b08 100644
--- a/build/rpmfc.h
+++ b/build/rpmfc.h
@@ -38,7 +38,7 @@ enum FCOLOR_e {
/** \ingroup rpmfc
*/
-typedef enum FCOLOR_e FCOLOR_t;
+typedef rpmFlags FCOLOR_t;
/** \ingroup rpmfc
*/
diff --git a/build/rpmspec.h b/build/rpmspec.h
index 8b8ce3d35..cc0596edf 100644
--- a/build/rpmspec.h
+++ b/build/rpmspec.h
@@ -17,21 +17,25 @@ extern "C" {
*/
typedef struct Package_s * Package;
-typedef enum rpmSourceFlags_e {
+enum rpmSourceFlags_e {
RPMBUILD_ISSOURCE = (1 << 0),
RPMBUILD_ISPATCH = (1 << 1),
RPMBUILD_ISICON = (1 << 2),
RPMBUILD_ISNO = (1 << 3),
-} rpmSourceFlags;
+};
+
+typedef rpmFlags rpmSourceFlags;
#define RPMBUILD_DEFAULT_LANG "C"
-typedef enum rpmSpecFlags_e {
+enum rpmSpecFlags_e {
RPMSPEC_NONE = 0,
RPMSPEC_ANYARCH = (1 << 0),
RPMSPEC_FORCE = (1 << 1),
RPMSPEC_NOLANG = (1 << 2),
-} rpmSpecFlags;
+};
+
+typedef rpmFlags rpmSpecFlags;
/** \ingroup rpmbuild
*/
diff --git a/lib/fsm.h b/lib/fsm.h
index 883c57f40..05e04c9d4 100644
--- a/lib/fsm.h
+++ b/lib/fsm.h
@@ -89,7 +89,7 @@ typedef enum fileStage_e {
/** \ingroup payload
*/
-typedef enum cpioMapFlags_e {
+enum cpioMapFlags_e {
CPIO_MAP_PATH = (1 << 0),
CPIO_MAP_MODE = (1 << 1),
CPIO_MAP_UID = (1 << 2),
@@ -100,7 +100,8 @@ typedef enum cpioMapFlags_e {
CPIO_ALL_HARDLINKS = (1 << 7), /*!< fail if hardlinks are missing. */
CPIO_MAP_TYPE = (1 << 8), /*!< only for building. */
CPIO_SBIT_CHECK = (1 << 9)
-} cpioMapFlags;
+};
+typedef rpmFlags cpioMapFlags;
typedef struct fsmIterator_s * FSMI_t;
typedef struct fsm_s * FSM_t;
diff --git a/lib/header.c b/lib/header.c
index aaa2a9808..3f8877d24 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -66,12 +66,14 @@ static const int typeSizes[16] = {
0
};
-typedef enum headerFlags_e {
+enum headerFlags_e {
HEADERFLAG_SORTED = (1 << 0), /*!< Are header entries sorted? */
HEADERFLAG_ALLOCATED = (1 << 1), /*!< Is 1st header region allocated? */
HEADERFLAG_LEGACY = (1 << 2), /*!< Header came from legacy source? */
HEADERFLAG_DEBUG = (1 << 3), /*!< Debug this header? */
-} headerFlags;
+};
+
+typedef rpmFlags headerFlags;
/** \ingroup header
* The Header data structure.
diff --git a/lib/header.h b/lib/header.h
index e038184ad..a837fc984 100644
--- a/lib/header.h
+++ b/lib/header.h
@@ -156,14 +156,16 @@ int headerIsEntry(Header h, rpmTag tag);
* tags don't generally honor the other flags, MINMEM, RAW, ALLOC and ARGV
* are only relevant for non-extension data.
*/
-typedef enum headerGetFlags_e {
+enum headerGetFlags_e {
HEADERGET_DEFAULT = 0, /* legacy headerGetEntry() behavior */
HEADERGET_MINMEM = (1 << 0), /* pointers can refer to header memory */
HEADERGET_EXT = (1 << 1), /* lookup extension types too */
HEADERGET_RAW = (1 << 2), /* return raw contents (no i18n lookups) */
HEADERGET_ALLOC = (1 << 3), /* always allocate memory for all data */
HEADERGET_ARGV = (1 << 4), /* return string arrays NULL-terminated */
-} headerGetFlags;
+};
+
+typedef rpmFlags headerGetFlags;
/** \ingroup header
* Retrieve tag value.
@@ -176,10 +178,12 @@ typedef enum headerGetFlags_e {
int headerGet(Header h, rpmTag tag, rpmtd td, headerGetFlags flags);
-typedef enum headerPutFlags_e {
+enum headerPutFlags_e {
HEADERPUT_DEFAULT = 0,
HEADERPUT_APPEND = (1 << 0),
-} headerPutFlags;
+};
+
+typedef rpmFlags headerPutFlags;
/** \ingroup header
* Add or append tag to header.
diff --git a/lib/rpmcli.h b/lib/rpmcli.h
index d15862d76..749a57532 100644
--- a/lib/rpmcli.h
+++ b/lib/rpmcli.h
@@ -75,7 +75,7 @@ rpmcliFini(poptContext optCon);
* Query/Verify argument qualifiers.
* @todo Reassign to tag values.
*/
-typedef enum rpmQVSources_e {
+enum rpmQVSources_e {
RPMQV_PACKAGE = 0, /*!< ... from package name db search. */
RPMQV_PATH, /*!< ... from file path db search. */
RPMQV_ALL, /*!< ... from each installed package. */
@@ -90,13 +90,15 @@ typedef enum rpmQVSources_e {
RPMQV_HDRID, /*!< ... from header id (immutable header SHA1). */
RPMQV_FILEID, /*!< ... from file id (file MD5). */
RPMQV_TID, /*!< ... from install transaction id (time stamp). */
-} rpmQVSources;
+};
+
+typedef rpmFlags rpmQVSources;
/** \ingroup rpmcli
* Bit(s) to control rpmQuery() operation, stored in qva_flags.
* @todo Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs?.
*/
-typedef enum rpmQueryFlags_e {
+enum rpmQueryFlags_e {
QUERY_FOR_DEFAULT = 0, /*!< */
QUERY_MD5 = (1 << 0), /*!< from --nomd5 */
QUERY_FILEDIGEST = (1 << 0), /*!< from --nofiledigest, same as --nomd5 */
@@ -121,7 +123,9 @@ typedef enum rpmQueryFlags_e {
QUERY_FOR_DOCS = (1 << 25), /*!< query: from --docfiles */
QUERY_FOR_CONFIG = (1 << 26), /*!< query: from --configfiles */
QUERY_FOR_DUMPFILES = (1 << 27) /*!< query: from --dump */
-} rpmQueryFlags;
+};
+
+typedef rpmFlags rpmQueryFlags;
#define _QUERY_FOR_BITS \
(QUERY_FOR_LIST|QUERY_FOR_STATE|QUERY_FOR_DOCS|QUERY_FOR_CONFIG|\
@@ -265,7 +269,7 @@ int rpmcliVerify(rpmts ts, QVA_t qva, ARGV_const_t argv);
/** \ingroup rpmcli
* Bit(s) to control rpmInstall() operation.
*/
-typedef enum rpmInstallFlags_e {
+enum rpmInstallFlags_e {
INSTALL_NONE = 0,
INSTALL_PERCENT = (1 << 0), /*!< from --percent */
INSTALL_HASH = (1 << 1), /*!< from --hash */
@@ -277,7 +281,9 @@ typedef enum rpmInstallFlags_e {
INSTALL_INSTALL = (1 << 7), /*!< from --install */
INSTALL_ERASE = (1 << 8), /*!< from --erase */
INSTALL_ALLMATCHES = (1 << 9) /*!< from --allmatches */
-} rpmInstallFlags;
+};
+
+typedef rpmFlags rpmInstallFlags;
/** \ingroup rpmcli
* Bit(s) to control rpmErase() operation.
diff --git a/lib/rpmds.h b/lib/rpmds.h
index b093224f9..7d5a95115 100644
--- a/lib/rpmds.h
+++ b/lib/rpmds.h
@@ -22,7 +22,7 @@ extern int _rpmds_nopromote;
/** \ingroup rpmds
* Dependency Attributes.
*/
-typedef enum rpmsenseFlags_e {
+enum rpmsenseFlags_e {
RPMSENSE_ANY = 0,
RPMSENSE_LESS = (1 << 1),
RPMSENSE_GREATER = (1 << 2),
@@ -49,7 +49,9 @@ typedef enum rpmsenseFlags_e {
RPMSENSE_KEYRING = (1 << 26),
/* bit 27 unused */
RPMSENSE_CONFIG = (1 << 28)
-} rpmsenseFlags;
+};
+
+typedef rpmFlags rpmsenseFlags;
#define RPMSENSE_SENSEMASK 15 /* Mask to get senses, ie serial, */
/* less, greater, equal. */
diff --git a/lib/rpmfi.h b/lib/rpmfi.h
index 84f6da80a..75dfd1ef7 100644
--- a/lib/rpmfi.h
+++ b/lib/rpmfi.h
@@ -46,7 +46,7 @@ typedef enum rpmfileState_e {
/**
* File Attributes.
*/
-typedef enum rpmfileAttrs_e {
+enum rpmfileAttrs_e {
RPMFILE_NONE = 0,
RPMFILE_CONFIG = (1 << 0), /*!< from %%config */
RPMFILE_DOC = (1 << 1), /*!< from %%doc */
@@ -60,7 +60,9 @@ typedef enum rpmfileAttrs_e {
RPMFILE_EXCLUDE = (1 << 9), /*!< from %%exclude, internal */
RPMFILE_UNPATCHED = (1 << 10), /*!< placeholder (SuSE) */
RPMFILE_PUBKEY = (1 << 11), /*!< from %%pubkey */
-} rpmfileAttrs;
+};
+
+typedef rpmFlags rpmfileAttrs;
#define RPMFILE_ALL ~(RPMFILE_NONE)
@@ -367,7 +369,7 @@ rpmfi rpmfiInitD(rpmfi fi, int dx);
*/
rpmfi rpmfiFree(rpmfi fi);
-typedef enum rpmfiFlags_e {
+enum rpmfiFlags_e {
RPMFI_NOHEADER = 0,
RPMFI_KEEPHEADER = (1 << 0),
RPMFI_NOFILECLASS = (1 << 1),
@@ -389,7 +391,9 @@ typedef enum rpmfiFlags_e {
RPMFI_NOFILEFLAGS = (1 << 17),
RPMFI_ISBUILD = (1 << 30), /* internal */
RPMFI_ISSOURCE = (1 << 31), /* internal */
-} rpmfiFlags;
+};
+
+typedef rpmFlags rpmfiFlags;
#define RPMFI_FLAGS_ERASE \
(RPMFI_NOFILECLASS | RPMFI_NOFILELANGS | \
diff --git a/lib/rpmgi.h b/lib/rpmgi.h
index accbc0099..32b88064b 100644
--- a/lib/rpmgi.h
+++ b/lib/rpmgi.h
@@ -14,11 +14,13 @@ extern "C" {
/** \ingroup rpmgi
*/
-typedef enum rpmgiFlags_e {
+enum rpmgiFlags_e {
RPMGI_NONE = 0,
RPMGI_NOGLOB = (1 << 2),
RPMGI_NOMANIFEST = (1 << 3),
-} rpmgiFlags;
+};
+
+typedef rpmFlags rpmgiFlags;
extern rpmgiFlags giFlags;
diff --git a/lib/rpmplugins.h b/lib/rpmplugins.h
index ae82865a4..79855596c 100644
--- a/lib/rpmplugins.h
+++ b/lib/rpmplugins.h
@@ -16,7 +16,7 @@ extern "C" {
#define PLUGINHOOK_COLL_POST_ANY_FUNC pluginhook_coll_post_any
#define PLUGINHOOK_COLL_PRE_REMOVE_FUNC pluginhook_coll_pre_remove
-typedef enum rpmPluginHook_e {
+enum rpmPluginHook_e {
PLUGINHOOK_NONE = 0,
PLUGINHOOK_INIT = 1 << 0,
PLUGINHOOK_CLEANUP = 1 << 1,
@@ -24,7 +24,9 @@ typedef enum rpmPluginHook_e {
PLUGINHOOK_COLL_POST_ADD = 1 << 3,
PLUGINHOOK_COLL_POST_ANY = 1 << 4,
PLUGINHOOK_COLL_PRE_REMOVE = 1 << 5
-} rpmPluginHook;
+};
+
+typedef rpmFlags rpmPluginHook;
/** \ingroup rpmplugins
* Create a new plugins structure
diff --git a/lib/rpmpol.h b/lib/rpmpol.h
index ee74a84fc..f5aef28ad 100644
--- a/lib/rpmpol.h
+++ b/lib/rpmpol.h
@@ -6,14 +6,18 @@
* Structure(s) used for policy sets.
*/
+#include <rpm/rpmtypes.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-typedef enum rpmpolFlags_e {
+enum rpmpolFlags_e {
RPMPOL_FLAG_NONE = 0,
RPMPOL_FLAG_BASE = (1 << 0)
-} rpmpolFlags;
+};
+
+typedef rpmFlags rpmpolFlags;
#define RPMPOL_TYPE_DEFAULT "default"
diff --git a/lib/rpmprob.h b/lib/rpmprob.h
index 5ca5d1124..2b89f15ef 100644
--- a/lib/rpmprob.h
+++ b/lib/rpmprob.h
@@ -18,7 +18,7 @@ typedef struct rpmProblem_s * rpmProblem;
/** \ingroup rpmprob
* @todo Generalize filter mechanism.
*/
-typedef enum rpmprobFilterFlags_e {
+enum rpmprobFilterFlags_e {
RPMPROB_FILTER_NONE = 0,
RPMPROB_FILTER_IGNOREOS = (1 << 0), /*!< from --ignoreos */
RPMPROB_FILTER_IGNOREARCH = (1 << 1), /*!< from --ignorearch */
@@ -29,7 +29,9 @@ typedef enum rpmprobFilterFlags_e {
RPMPROB_FILTER_OLDPACKAGE = (1 << 6), /*!< from --oldpackage */
RPMPROB_FILTER_DISKSPACE = (1 << 7), /*!< from --ignoresize */
RPMPROB_FILTER_DISKNODES = (1 << 8) /*!< from --ignoresize */
-} rpmprobFilterFlags;
+};
+
+typedef rpmFlags rpmprobFilterFlags;
/** \ingroup rpmprob
* Enumerate transaction set problem types.
diff --git a/lib/rpmscript.h b/lib/rpmscript.h
index af2cb6a29..c0a78f091 100644
--- a/lib/rpmscript.h
+++ b/lib/rpmscript.h
@@ -4,11 +4,13 @@
#include <rpm/rpmtypes.h>
#include <rpm/argv.h>
-typedef enum rpmscriptFlags_e {
+enum rpmscriptFlags_e {
RPMSCRIPT_NONE = 0,
RPMSCRIPT_EXPAND = (1 << 0), /* macro expansion */
RPMSCRIPT_QFORMAT = (1 << 1), /* header queryformat expansion */
-} rpmscriptFlags;
+};
+
+typedef rpmFlags rpmscriptFlags;
typedef struct rpmScript_s * rpmScript;
diff --git a/lib/rpmtag.h b/lib/rpmtag.h
index 8ff371f96..0011f657b 100644
--- a/lib/rpmtag.h
+++ b/lib/rpmtag.h
@@ -381,13 +381,15 @@ typedef enum rpmSubTagType_e {
/** \ingroup header
* * Identify how to return the header data type.
* */
-typedef enum rpmTagReturnType_e {
+enum rpmTagReturnType_e {
RPM_ANY_RETURN_TYPE = 0,
RPM_SCALAR_RETURN_TYPE = 0x00010000,
RPM_ARRAY_RETURN_TYPE = 0x00020000,
RPM_MAPPING_RETURN_TYPE = 0x00040000,
RPM_MASK_RETURN_TYPE = 0xffff0000
-} rpmTagReturnType;
+};
+
+typedef rpmFlags rpmTagReturnType;
/** \ingroup rpmtag
* Return tag name from value.
diff --git a/lib/rpmtd.h b/lib/rpmtd.h
index d02287f1f..d395aef56 100644
--- a/lib/rpmtd.h
+++ b/lib/rpmtd.h
@@ -8,13 +8,15 @@
extern "C" {
#endif
-typedef enum rpmtdFlags_e {
+enum rpmtdFlags_e {
RPMTD_NONE = 0,
RPMTD_ALLOCED = (1 << 0), /* was memory allocated? */
RPMTD_PTR_ALLOCED = (1 << 1), /* were array pointers allocated? */
RPMTD_IMMUTABLE = (1 << 2), /* header data or modifiable? */
RPMTD_ARGV = (1 << 3), /* string array is NULL-terminated? */
-} rpmtdFlags;
+};
+
+typedef rpmFlags rpmtdFlags;
/** \ingroup rpmtd
* Container for rpm tag data (from headers or extensions).
diff --git a/lib/rpmts.h b/lib/rpmts.h
index e03a70469..a5e676dfb 100644
--- a/lib/rpmts.h
+++ b/lib/rpmts.h
@@ -25,7 +25,7 @@ extern int _rpmts_stats;
/** \ingroup rpmts
* Bit(s) to control rpmtsRun() operation.
*/
-typedef enum rpmtransFlags_e {
+enum rpmtransFlags_e {
RPMTRANS_FLAG_NONE = 0,
RPMTRANS_FLAG_TEST = (1 << 0), /*!< from --test */
RPMTRANS_FLAG_BUILD_PROBS = (1 << 1), /*!< don't process payload */
@@ -63,7 +63,9 @@ typedef enum rpmtransFlags_e {
RPMTRANS_FLAG_ADDINDEPS = (1 << 29), /*!< from --aid */
RPMTRANS_FLAG_NOCONFIGS = (1 << 30), /*!< from --noconfigs */
RPMTRANS_FLAG_DEPLOOPS = (1 << 31) /*!< from --deploops */
-} rpmtransFlags;
+};
+
+typedef rpmFlags rpmtransFlags;
#define _noTransScripts \
( RPMTRANS_FLAG_NOPRE | \
@@ -82,7 +84,7 @@ typedef enum rpmtransFlags_e {
/** \ingroup rpmts
* Bit(s) to control digest and signature verification.
*/
-typedef enum rpmVSFlags_e {
+enum rpmVSFlags_e {
RPMVSF_DEFAULT = 0,
RPMVSF_NOHDRCHK = (1 << 0),
RPMVSF_NEEDPAYLOAD = (1 << 1),
@@ -97,7 +99,9 @@ typedef enum rpmVSFlags_e {
RPMVSF_NODSA = (1 << 18),
RPMVSF_NORSA = (1 << 19)
/* bit(s) 16-31 unused */
-} rpmVSFlags;
+};
+
+typedef rpmFlags rpmVSFlags;
#define _RPMVSF_NODIGESTS \
( RPMVSF_NOSHA1HEADER | \
diff --git a/lib/rpmtypes.h b/lib/rpmtypes.h
index 197516e0b..c6f3805f6 100644
--- a/lib/rpmtypes.h
+++ b/lib/rpmtypes.h
@@ -36,6 +36,8 @@ typedef struct rpmtd_s * rpmtd;
typedef uint32_t rpm_color_t;
typedef uint32_t rpm_flag_t;
typedef uint32_t rpm_tid_t;
+
+typedef uint32_t rpmFlags;
/** @} */
/** \ingroup rpmtypes
diff --git a/lib/rpmvf.h b/lib/rpmvf.h
index 57879557e..51690b857 100644
--- a/lib/rpmvf.h
+++ b/lib/rpmvf.h
@@ -14,7 +14,7 @@ extern "C" {
/** \ingroup rpmvf
* Bit(s) for rpmVerifyFile() attributes and result.
*/
-typedef enum rpmVerifyAttrs_e {
+enum rpmVerifyAttrs_e {
RPMVERIFY_NONE = 0, /*!< */
RPMVERIFY_MD5 = (1 << 0), /*!< from %verify(md5) - obsolete */
RPMVERIFY_FILEDIGEST= (1 << 0), /*!< from %verify(filedigest) */
@@ -34,7 +34,10 @@ typedef enum rpmVerifyAttrs_e {
RPMVERIFY_READFAIL = (1 << 29), /*!< file read failed */
RPMVERIFY_LSTATFAIL = (1 << 30), /*!< lstat failed */
RPMVERIFY_LGETFILECONFAIL = (1 << 31) /*!< lgetfilecon failed */
-} rpmVerifyAttrs;
+};
+
+typedef rpmFlags rpmVerifyAttrs;
+
#define RPMVERIFY_ALL ~(RPMVERIFY_NONE)
#define RPMVERIFY_FAILURES \
(RPMVERIFY_LSTATFAIL|RPMVERIFY_READFAIL|RPMVERIFY_READLINKFAIL|RPMVERIFY_LGETFILECONFAIL)
@@ -42,7 +45,7 @@ typedef enum rpmVerifyAttrs_e {
/** \ingroup rpmvf
* Bit(s) to control rpmVerify() operation
*/
-typedef enum rpmVerifyFlags_e {
+enum rpmVerifyFlags_e {
VERIFY_DEFAULT = 0, /*!< */
VERIFY_MD5 = (1 << 0), /*!< from --nomd5 - obsolete */
VERIFY_FILEDIGEST = (1 << 0), /*!< from --nofiledigest */
@@ -69,7 +72,9 @@ typedef enum rpmVerifyFlags_e {
VERIFY_FOR_CONFIG = (1 << 26), /*!< query: from --configfiles */
VERIFY_FOR_DUMPFILES= (1 << 27) /*!< query: from --dump */
/* bits 28-31 used in rpmVerifyAttrs */
-} rpmVerifyFlags;
+};
+
+typedef rpmFlags rpmVerifyFlags;
#define VERIFY_ATTRS \
( VERIFY_FILEDIGEST | VERIFY_SIZE | VERIFY_LINKTO | VERIFY_USER | VERIFY_GROUP | \
diff --git a/lib/tagexts.c b/lib/tagexts.c
index 22e2c7ed7..78515c752 100644
--- a/lib/tagexts.c
+++ b/lib/tagexts.c
@@ -596,13 +596,14 @@ static int headercolorTag(Header h, rpmtd td, headerGetFlags hgflags)
return numberTag(td, hcolor);
}
-typedef enum nevraFlags_e {
+enum nevraFlags_e {
NEVRA_NAME = (1 << 0),
NEVRA_EPOCH = (1 << 1),
NEVRA_VERSION = (1 << 2),
NEVRA_RELEASE = (1 << 3),
NEVRA_ARCH = (1 << 4)
-} nevraFlags;
+};
+typedef rpmFlags nevraFlags;
static int getNEVRA(Header h, rpmtd td, nevraFlags flags)
{
diff --git a/rpmio/argv.h b/rpmio/argv.h
index 86ec1373a..d73a3c35f 100644
--- a/rpmio/argv.h
+++ b/rpmio/argv.h
@@ -6,6 +6,7 @@
*/
#include <stdio.h>
+#include <rpm/rpmtypes.h>
#ifdef __cplusplus
extern "C" {
@@ -138,10 +139,12 @@ int argvAddNum(ARGV_t * argvp, int val);
*/
int argvAppend(ARGV_t * argvp, ARGV_const_t av);
-typedef enum argvFlags_e {
+enum argvFlags_e {
ARGV_NONE = 0,
ARGV_SKIPEMPTY = (1 << 0), /* omit empty strings from result */
-} argvFlags;
+};
+
+typedef rpmFlags argvFlags;
/** \ingroup rpmargv
* Split a string into an argv array.
diff --git a/rpmio/rpmpgp.h b/rpmio/rpmpgp.h
index 2db5e91fa..c30cfaac3 100644
--- a/rpmio/rpmpgp.h
+++ b/rpmio/rpmpgp.h
@@ -930,9 +930,11 @@ typedef enum pgpValType_e {
/** \ingroup rpmpgp
* Bit(s) to control digest operation.
*/
-typedef enum rpmDigestFlags_e {
+enum rpmDigestFlags_e {
RPMDIGEST_NONE = 0
-} rpmDigestFlags;
+};
+
+typedef rpmFlags rpmDigestFlags;
/** \ingroup rpmpgp
* Return string representation of am OpenPGP value.