summaryrefslogtreecommitdiffstats
path: root/ignore.h
blob: d2c0c5d7f4f2c00966f09a02e1a5652c7abd3bb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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