dpkg 1.22.7-3-g89f48
|
Data Structures | |
struct | dpkg_arch |
Enumerations | |
enum | dpkg_arch_type { DPKG_ARCH_NONE , DPKG_ARCH_EMPTY , DPKG_ARCH_ILLEGAL , DPKG_ARCH_WILDCARD , DPKG_ARCH_ALL , DPKG_ARCH_NATIVE , DPKG_ARCH_FOREIGN , DPKG_ARCH_UNKNOWN } |
Functions | |
const char * | dpkg_arch_name_is_illegal (const char *name) DPKG_ATTR_NONNULL(1) |
Verify if the architecture name is valid. | |
struct dpkg_arch * | dpkg_arch_find (const char *name) |
Retrieve the struct dpkg_arch for the given architecture. | |
struct dpkg_arch * | dpkg_arch_get (enum dpkg_arch_type type) |
Return the struct dpkg_arch corresponding to the architecture type. | |
struct dpkg_arch * | dpkg_arch_get_list (void) |
Return the complete list of architectures. | |
void | dpkg_arch_reset_list (void) |
Reset the list of architectures. | |
const char * | dpkg_arch_describe (const struct dpkg_arch *arch) |
Return a descriptive architecture name. | |
struct dpkg_arch * | dpkg_arch_add (const char *name) |
Add a new foreign dpkg_arch architecture. | |
void | dpkg_arch_unmark (const struct dpkg_arch *arch) |
Unmark a foreign dpkg_arch architecture. | |
void | dpkg_arch_load_list (void) |
Load the architecture database. | |
void | dpkg_arch_save_list (void) |
Save the architecture database. | |
void | varbuf_add_archqual (struct varbuf *vb, const struct dpkg_arch *arch) |
enum dpkg_arch_type |
struct dpkg_arch * dpkg_arch_add | ( | const char * | name | ) |
Add a new foreign dpkg_arch architecture.
References dpkg_arch_find(), DPKG_ARCH_FOREIGN, DPKG_ARCH_UNKNOWN, dpkg_arch::name, and dpkg_arch::type.
Referenced by dpkg_arch_load_list().
const char * dpkg_arch_describe | ( | const struct dpkg_arch * | arch | ) |
Return a descriptive architecture name.
References C_, DPKG_ARCH_EMPTY, DPKG_ARCH_NONE, dpkg_arch::name, and dpkg_arch::type.
struct dpkg_arch * dpkg_arch_find | ( | const char * | name | ) |
Retrieve the struct dpkg_arch for the given architecture.
Create a new structure for the architecture if it is not yet known from the system, in that case it will have type == DPKG_ARCH_UNKNOWN, if the architecture is illegal it will have type == DPKG_ARCH_ILLEGAL, if name is an empty string it will have type == DPKG_ARCH_EMPTY, and if it is NULL then it will have type == DPKG_ARCH_NONE.
name | The architecture name. |
References DPKG_ARCH_ILLEGAL, dpkg_arch_name_is_illegal(), DPKG_ARCH_UNKNOWN, dpkg_arch::name, dpkg_arch::next, and dpkg_arch::type.
Referenced by dpkg_arch_add(), f_architecture(), and f_dependency().
struct dpkg_arch * dpkg_arch_get | ( | enum dpkg_arch_type | type | ) |
Return the struct dpkg_arch corresponding to the architecture type.
The function only returns instances for types which are unique. For forward-compatibility any unknown type will return NULL.
References DPKG_ARCH_ALL, DPKG_ARCH_EMPTY, DPKG_ARCH_FOREIGN, DPKG_ARCH_ILLEGAL, DPKG_ARCH_NATIVE, DPKG_ARCH_NONE, DPKG_ARCH_UNKNOWN, DPKG_ARCH_WILDCARD, internerr, and dpkg_arch::type.
Referenced by deparchsatisfied(), f_dependency(), pkg_blank(), printarch(), and process_archive().
struct dpkg_arch * dpkg_arch_get_list | ( | void | ) |
Return the complete list of architectures.
In fact it returns the first item of the linked list and you can traverse the list by following arch->next until it's NULL.
Referenced by print_foreign_arches().
void dpkg_arch_load_list | ( | void | ) |
Load the architecture database.
References dpkg_arch_add(), DPKG_DB_ARCH_FILE, dpkg_db_get_path(), and fgets_checked().
Referenced by modstatdb_open(), and print_foreign_arches().
const char * dpkg_arch_name_is_illegal | ( | const char * | name | ) |
Verify if the architecture name is valid.
Returns NULL if the architecture name is valid. Otherwise it returns a string describing why it's not valid. Currently it ensures the name starts with an alphanumeric and is then composed of a combinations of hyphens and alphanumerics.
The function will abort if you pass it a NULL pointer.
name | The architecture name to verify. |
Referenced by dpkg_arch_find(), f_architecture(), f_dependency(), pkg_spec_is_illegal(), and validate_archname().
void dpkg_arch_reset_list | ( | void | ) |
Reset the list of architectures.
Must be called before nffreeall() to ensure we don't point to unallocated memory.
References dpkg_arch::next.
Referenced by pkg_hash_reset().
void dpkg_arch_save_list | ( | void | ) |
Save the architecture database.
References _, atomic_file_close(), atomic_file_commit(), atomic_file_free(), ATOMIC_FILE_MKPATH, atomic_file_new(), atomic_file_open(), atomic_file_sync(), dir_sync_path(), DPKG_ARCH_FOREIGN, DPKG_ARCH_NATIVE, DPKG_DB_ARCH_FILE, dpkg_db_get_dir(), dpkg_db_get_path(), dpkg_arch::name, dpkg_arch::next, ohshite(), and dpkg_arch::type.
void dpkg_arch_unmark | ( | const struct dpkg_arch * | arch | ) |
Unmark a foreign dpkg_arch architecture.
References DPKG_ARCH_FOREIGN, DPKG_ARCH_UNKNOWN, dpkg_arch::next, and dpkg_arch::type.
References DPKG_ARCH_EMPTY, DPKG_ARCH_NONE, dpkg_arch::name, dpkg_arch::type, varbuf_add_char(), and varbuf_add_str.
Referenced by pkg_infodb_get_file(), varbuf_add_pkgbin_name(), and varbufdependency().