Commit | Line | Data |
---|---|---|
1479465f GJ |
1 | /* |
2 | * libdpkg - Debian packaging suite library routines | |
3 | * arch.h - architecture database functions | |
4 | * | |
5 | * Copyright © 2011 Linaro Limited | |
6 | * Copyright © 2011 Raphaël Hertzog <hertzog@debian.org> | |
7 | * Copyright © 2011-2014 Guillem Jover <guillem@debian.org> | |
8 | * | |
9 | * This is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License as published by | |
11 | * the Free Software Foundation; either version 2 of the License, or | |
12 | * (at your option) any later version. | |
13 | * | |
14 | * This is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | |
21 | */ | |
22 | ||
23 | #ifndef LIBDPKG_ARCH_H | |
24 | #define LIBDPKG_ARCH_H | |
25 | ||
26 | #include <dpkg/macros.h> | |
27 | #include <dpkg/varbuf.h> | |
28 | ||
29 | DPKG_BEGIN_DECLS | |
30 | ||
31 | /** | |
32 | * @defgroup arch Architecture database | |
33 | * @ingroup dpkg-public | |
34 | * @{ | |
35 | */ | |
36 | ||
37 | enum dpkg_arch_type { | |
38 | DPKG_ARCH_NONE, | |
39 | DPKG_ARCH_EMPTY, | |
40 | DPKG_ARCH_ILLEGAL, | |
41 | DPKG_ARCH_WILDCARD, | |
42 | DPKG_ARCH_ALL, | |
43 | DPKG_ARCH_NATIVE, | |
44 | DPKG_ARCH_FOREIGN, | |
45 | DPKG_ARCH_UNKNOWN, | |
46 | }; | |
47 | ||
48 | struct dpkg_arch { | |
49 | struct dpkg_arch *next; | |
50 | const char *name; | |
51 | enum dpkg_arch_type type; | |
52 | }; | |
53 | ||
54 | const char *dpkg_arch_name_is_illegal(const char *name) DPKG_ATTR_NONNULL(1); | |
55 | struct dpkg_arch *dpkg_arch_find(const char *name); | |
56 | struct dpkg_arch *dpkg_arch_get(enum dpkg_arch_type type); | |
57 | struct dpkg_arch *dpkg_arch_get_list(void); | |
58 | void dpkg_arch_reset_list(void); | |
59 | ||
60 | const char *dpkg_arch_describe(const struct dpkg_arch *arch); | |
61 | ||
62 | struct dpkg_arch *dpkg_arch_add(const char *name); | |
63 | void dpkg_arch_unmark(struct dpkg_arch *arch); | |
64 | void dpkg_arch_load_list(void); | |
65 | void dpkg_arch_save_list(void); | |
66 | ||
67 | void varbuf_add_archqual(struct varbuf *vb, const struct dpkg_arch *arch); | |
68 | ||
69 | /** @} */ | |
70 | ||
71 | DPKG_END_DECLS | |
72 | ||
73 | #endif /* LIBDPKG_ARCH_H */ |