dpkg 1.21.11
arch.h
Go to the documentation of this file.
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
30
46};
47
48struct dpkg_arch {
49 struct dpkg_arch *next;
50 const char *name;
52};
53
54const char *dpkg_arch_name_is_illegal(const char *name) DPKG_ATTR_NONNULL(1);
55struct dpkg_arch *dpkg_arch_find(const char *name);
57struct dpkg_arch *dpkg_arch_get_list(void);
58void dpkg_arch_reset_list(void);
59
60const char *dpkg_arch_describe(const struct dpkg_arch *arch);
61
62struct dpkg_arch *dpkg_arch_add(const char *name);
63void dpkg_arch_unmark(const struct dpkg_arch *arch);
64void dpkg_arch_load_list(void);
65void dpkg_arch_save_list(void);
66
67void varbuf_add_archqual(struct varbuf *vb, const struct dpkg_arch *arch);
68
72
73#endif /* LIBDPKG_ARCH_H */
void dpkg_arch_save_list(void)
Save the architecture database.
Definition: arch.c:310
struct dpkg_arch * dpkg_arch_get(enum dpkg_arch_type type)
Return the struct dpkg_arch corresponding to the architecture type.
Definition: arch.c:170
struct dpkg_arch * dpkg_arch_get_list(void)
Return the complete list of architectures.
Definition: arch.c:200
const char * dpkg_arch_describe(const struct dpkg_arch *arch)
Return a descriptive architecture name.
Definition: arch.c:234
void dpkg_arch_unmark(const struct dpkg_arch *arch)
Unmark a foreign dpkg_arch architecture.
Definition: arch.c:265
struct dpkg_arch * dpkg_arch_add(const char *name)
Add a new foreign dpkg_arch architecture.
Definition: arch.c:248
void dpkg_arch_reset_list(void)
Reset the list of architectures.
Definition: arch.c:212
struct dpkg_arch * dpkg_arch_find(const char *name)
Retrieve the struct dpkg_arch for the given architecture.
Definition: arch.c:136
dpkg_arch_type
Definition: arch.h:37
void varbuf_add_archqual(struct varbuf *vb, const struct dpkg_arch *arch)
Definition: arch.c:219
const char * dpkg_arch_name_is_illegal(const char *name) DPKG_ATTR_NONNULL(1)
Verify if the architecture name is valid.
Definition: arch.c:56
void dpkg_arch_load_list(void)
Load the architecture database.
Definition: arch.c:285
@ DPKG_ARCH_UNKNOWN
Definition: arch.h:45
@ DPKG_ARCH_NONE
Definition: arch.h:38
@ DPKG_ARCH_EMPTY
Definition: arch.h:39
@ DPKG_ARCH_ALL
Definition: arch.h:42
@ DPKG_ARCH_ILLEGAL
Definition: arch.h:40
@ DPKG_ARCH_FOREIGN
Definition: arch.h:44
@ DPKG_ARCH_NATIVE
Definition: arch.h:43
@ DPKG_ARCH_WILDCARD
Definition: arch.h:41
#define DPKG_BEGIN_DECLS
Definition: macros.h:86
#define DPKG_ATTR_NONNULL(...)
Definition: macros.h:64
#define DPKG_END_DECLS
Definition: macros.h:87
Definition: arch.h:48
const char * name
Definition: arch.h:50
enum dpkg_arch_type type
Definition: arch.h:51
struct dpkg_arch * next
Definition: arch.h:49
varbuf_init must be called exactly once before the use of each varbuf (including before any call to v...
Definition: varbuf.h:55