test: Fix varbuf memory leak in t-pkg-format test
[dpkg.git] / src / common / force.h
blobc232c7f8c6657ea54ce2db5e1a6e8fdd44536d43
1 /*
2 * dpkg - main program for package management
3 * force.h - forced operation support
5 * Copyright © 1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
6 * Copyright © 2006, 2008-2019 Guillem Jover <guillem@debian.org>
8 * This is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 #ifndef DPKG_FORCE_H
23 #define DPKG_FORCE_H
25 #include <dpkg/dpkg.h>
26 #include <dpkg/options.h>
28 enum DPKG_ATTR_ENUM_FLAGS force_flags {
29 FORCE_ARCHITECTURE = DPKG_BIT(0),
30 FORCE_BAD_PATH = DPKG_BIT(1),
31 FORCE_BAD_VERIFY = DPKG_BIT(2),
32 FORCE_BAD_VERSION = DPKG_BIT(3),
33 FORCE_BREAKS = DPKG_BIT(4),
34 FORCE_CONFF_ASK = DPKG_BIT(5),
35 FORCE_CONFF_DEF = DPKG_BIT(6),
36 FORCE_CONFF_MISS = DPKG_BIT(7),
37 FORCE_CONFF_NEW = DPKG_BIT(8),
38 FORCE_CONFF_OLD = DPKG_BIT(9),
39 FORCE_CONFIGURE_ANY = DPKG_BIT(10),
40 FORCE_CONFLICTS = DPKG_BIT(11),
41 FORCE_DEPENDS = DPKG_BIT(12),
42 FORCE_DEPENDS_VERSION = DPKG_BIT(13),
43 FORCE_DOWNGRADE = DPKG_BIT(14),
44 FORCE_HOLD = DPKG_BIT(15),
45 FORCE_NON_ROOT = DPKG_BIT(16),
46 FORCE_OVERWRITE = DPKG_BIT(17),
47 FORCE_OVERWRITE_DIR = DPKG_BIT(18),
48 FORCE_OVERWRITE_DIVERTED = DPKG_BIT(19),
49 FORCE_REMOVE_ESSENTIAL = DPKG_BIT(20),
50 FORCE_REMOVE_REINSTREQ = DPKG_BIT(21),
51 FORCE_SCRIPT_CHROOTLESS = DPKG_BIT(22),
52 FORCE_UNSAFE_IO = DPKG_BIT(23),
53 FORCE_STATOVERRIDE_ADD = DPKG_BIT(24),
54 FORCE_STATOVERRIDE_DEL = DPKG_BIT(25),
55 FORCE_SECURITY_MAC = DPKG_BIT(26),
56 FORCE_REMOVE_PROTECTED = DPKG_BIT(27),
57 FORCE_ALL = 0xffffffff,
60 bool
61 in_force(int flags);
62 void
63 set_force(int flags);
64 void
65 reset_force(int flags);
67 char *
68 get_force_string(void);
70 void
71 parse_force(const char *value, bool set);
73 void
74 set_force_default(int mask);
75 void
76 set_force_option(const struct cmdinfo *cip, const char *value);
77 void
78 reset_force_option(const struct cmdinfo *cip, const char *value);
80 void
81 forcibleerr(int forceflag, const char *format, ...) DPKG_ATTR_PRINTF(2);
82 int
83 forcible_nonroot_error(int rc);
85 #endif /* DPKG_FORCE_H */