summaryrefslogtreecommitdiffstats
path: root/ignore.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ignore.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/ignore.h b/ignore.h
new file mode 100644
index 0000000..d2c0c5d
--- /dev/null
+++ b/ignore.h
@@ -0,0 +1,67 @@
+#ifndef REPREPRO_FORCE_H
+#define REPREPRO_FORCE_H
+
+#ifndef REPREPRO_ERROR_H
+#include "error.h"
+#endif
+
+#define VALID_IGNORES \
+ IGN(ignore) \
+ IGN(forbiddenchar) \
+ IGN(8bit) \
+ IGN(emptyfilenamepart) \
+ IGN(spaceonlyline) \
+ IGN(malformedchunk) \
+ IGN(unknownfield) \
+ IGN(wrongdistribution) \
+ IGN(missingfield) \
+ IGN(brokenold) \
+ IGN(brokenversioncmp) \
+ IGN(extension) \
+ IGN(unusedarch) \
+ IGN(surprisingarch) \
+ IGN(surprisingbinary) \
+ IGN(wrongsourceversion) \
+ IGN(wrongversion) \
+ IGN(dscinbinnmu) \
+ IGN(brokensignatures) \
+ IGN(uploaders) \
+ IGN(undefinedtarget) \
+ IGN(undefinedtracking) \
+ IGN(unusedoption) \
+ IGN(flatandnonflat) \
+ IGN(expiredkey) \
+ IGN(revokedkey) \
+ IGN(expiredsignature) \
+ IGN(wrongarchitecture) \
+ IGN(oldfile) \
+ IGN(longkeyid) \
+ IGN(missingfile) \
+ IGN(conflictingarchall)
+
+
+enum ignore {
+#define IGN(what) IGN_ ## what,
+ VALID_IGNORES
+#undef IGN
+
+ IGN_COUNT
+};
+
+extern int ignored[IGN_COUNT];
+extern bool ignore[IGN_COUNT];
+
+/* Having that as function avoids those strings to be duplacated everywhere */
+bool print_ignore_type_message(bool, enum ignore);
+
+#define IGNORING__(ignoring, what, ...) ({ \
+ fprintf(stderr, ## __VA_ARGS__); \
+ print_ignore_type_message(ignoring, IGN_ ## what ); \
+})
+#define IGNORING(what, ...) IGNORING__(true, what, __VA_ARGS__)
+#define IGNORING_(what, ...) IGNORING__(false, what, __VA_ARGS__)
+#define IGNORABLE(what) ignore[IGN_ ## what]
+
+retvalue set_ignore(const char *, bool, enum config_option_owner);
+
+#endif