libalpm
Arch Linux Package Manager Library
|
#include "alpm_list.h"
#include "alpm.h"
#include "package.h"
#include "handle.h"
#include "util-common.h"
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stddef.h>
#include <sys/types.h>
#include <math.h>
#include <float.h>
#include <fcntl.h>
#include <archive.h>
Go to the source code of this file.
Data Structures | |
struct | archive_read_buffer |
Used as a buffer/state holder for _alpm_archive_fgets(). More... | |
Macros | |
#define | _(s) (char *)s |
#define | MALLOC(p, s, action) do { p = malloc(s); if(p == NULL) { _alpm_alloc_fail(s); action; } } while(0) |
#define | CALLOC(p, l, s, action) do { p = calloc(l, s); if(p == NULL) { _alpm_alloc_fail(l * s); action; } } while(0) |
#define | REALLOC(p, s, action) do { void* np = realloc(p, s); if(np == NULL) { _alpm_alloc_fail(s); action; } else { p = np; } } while(0) |
#define | STRDUP(r, s, action) do { if(s != NULL) { r = strdup(s); if(r == NULL) { _alpm_alloc_fail(strlen(s)); action; } } else { r = NULL; } } while(0) |
#define | STRNDUP(r, s, l, action) do { if(s != NULL) { r = strndup(s, l); if(r == NULL) { _alpm_alloc_fail(l); action; } } else { r = NULL; } } while(0) |
#define | FREE(p) do { free(p); p = NULL; } while(0) |
#define | ASSERT(cond, action) do { if(!(cond)) { action; } } while(0) |
#define | RET_ERR_VOID(handle, err) |
#define | RET_ERR(handle, err, ret) |
#define | GOTO_ERR(handle, err, label) |
#define | RET_ERR_ASYNC_SAFE(handle, err, ret) |
#define | CHECK_HANDLE(handle, action) do { if(!(handle)) { action; } (handle)->pm_errno = ALPM_ERR_OK; } while(0) |
#define | ALPM_BUFFER_SIZE 8192 |
Standard buffer size used throughout the library. | |
#define | O_BINARY 0 |
#define | OPEN(fd, path, flags) do { fd = open(path, flags | O_BINARY); } while(fd == -1 && errno == EINTR) |
#define | SYMEXPORT __attribute__((visibility("default"))) |
#define | UNUSED __attribute__((unused)) |
Functions | |
char * | strsep (char **, const char *) |
Extracts tokens from a string. | |
struct archive_read_buffer |
#define _ | ( | s | ) | (char *)s |
Referenced by _cache_mtree_open(), _read_pkgreason(), alpm_add_pkg(), alpm_extract_keyid(), alpm_fetch_pkgurl(), alpm_find_group_pkgs(), alpm_pkg_load(), alpm_strerror(), build_filelist_from_mtree(), calculate_installed_size(), calculate_removed_size(), can_remove_file(), check_keyring(), check_literal(), check_mountpoint(), check_replacers(), check_validity(), checkdbdir(), commit_single_pkg(), create_tempfile(), curl_add_payload(), curl_check_finished_download(), curl_download_internal(), curl_download_internal_sandboxed(), curl_gethost(), download_files(), extract_single_file(), get_sync_dir(), init_gpgme(), key_import_keyserver(), key_import_wkd(), length_check(), load_packages(), load_pkg_for_entry(), local_db_create(), local_db_populate(), local_db_read(), mount_point_list(), mount_point_load_fsinfo(), parse_descfile(), perform_extraction(), remove_prepare_cascade(), remove_prepare_keep_needed(), resolvedep(), server_hard_error(), server_soft_error(), shift_pacsave(), sync_db_populate(), sync_db_read(), try_rename(), and unlink_file().
#define ALPM_BUFFER_SIZE 8192 |
Standard buffer size used throughout the library.
Referenced by _cache_mtree_open(), and build_filelist_from_mtree().
#define ASSERT | ( | cond, | |
action ) do { if(!(cond)) { action; } } while(0) |
Referenced by _package_changelog_open(), alpm_add_pkg(), alpm_compute_md5sum(), alpm_compute_sha256sum(), alpm_conflict_free(), alpm_db_add_cache_server(), alpm_db_add_server(), alpm_db_check_pgp_signature(), alpm_db_get_cache_servers(), alpm_db_get_group(), alpm_db_get_groupcache(), alpm_db_get_handle(), alpm_db_get_name(), alpm_db_get_pkg(), alpm_db_get_pkgcache(), alpm_db_get_servers(), alpm_db_get_siglevel(), alpm_db_get_usage(), alpm_db_get_valid(), alpm_db_remove_cache_server(), alpm_db_remove_server(), alpm_db_search(), alpm_db_set_cache_servers(), alpm_db_set_servers(), alpm_db_set_usage(), alpm_db_unregister(), alpm_db_update(), alpm_dep_compute_string(), alpm_dep_free(), alpm_depmissing_free(), alpm_fetch_pkgurl(), alpm_fileconflict_free(), alpm_find_dbs_satisfier(), alpm_logaction(), alpm_option_add_assumeinstalled(), alpm_option_add_cachedir(), alpm_option_add_hookdir(), alpm_option_remove_cachedir(), alpm_option_remove_hookdir(), alpm_option_set_dbext(), alpm_option_set_parallel_downloads(), alpm_pkg_changelog_close(), alpm_pkg_changelog_open(), alpm_pkg_changelog_read(), alpm_pkg_check_pgp_signature(), alpm_pkg_checkmd5sum(), alpm_pkg_free(), alpm_pkg_get_arch(), alpm_pkg_get_backup(), alpm_pkg_get_base(), alpm_pkg_get_base64_sig(), alpm_pkg_get_builddate(), alpm_pkg_get_checkdepends(), alpm_pkg_get_conflicts(), alpm_pkg_get_db(), alpm_pkg_get_depends(), alpm_pkg_get_desc(), alpm_pkg_get_filename(), alpm_pkg_get_files(), alpm_pkg_get_groups(), alpm_pkg_get_handle(), alpm_pkg_get_installdate(), alpm_pkg_get_isize(), alpm_pkg_get_licenses(), alpm_pkg_get_makedepends(), alpm_pkg_get_md5sum(), alpm_pkg_get_name(), alpm_pkg_get_optdepends(), alpm_pkg_get_origin(), alpm_pkg_get_packager(), alpm_pkg_get_provides(), alpm_pkg_get_reason(), alpm_pkg_get_replaces(), alpm_pkg_get_sha256sum(), alpm_pkg_get_sig(), alpm_pkg_get_size(), alpm_pkg_get_url(), alpm_pkg_get_validation(), alpm_pkg_get_version(), alpm_pkg_get_xdata(), alpm_pkg_has_scriptlet(), alpm_pkg_load(), alpm_pkg_mtree_close(), alpm_pkg_mtree_next(), alpm_pkg_mtree_open(), alpm_pkg_set_reason(), alpm_register_syncdb(), alpm_release(), alpm_remove_pkg(), alpm_sandbox_setup_child(), alpm_siglist_cleanup(), alpm_sync_get_new_version(), alpm_sync_sysupgrade(), alpm_trans_commit(), alpm_trans_get_add(), alpm_trans_get_flags(), alpm_trans_get_remove(), alpm_trans_init(), alpm_trans_interrupt(), alpm_trans_prepare(), alpm_trans_release(), alpm_unlock(), alpm_unregister_all_syncdbs(), commit_single_pkg(), compute_download_size(), compute_requiredby(), conflict_new(), curl_add_payload(), curl_check_finished_download(), finalize_download_file(), finalize_download_locations(), find_dl_candidates(), move_file(), prepare_resumable_downloads(), read_from_pipe(), and write_to_pipe().
#define CALLOC | ( | p, | |
l, | |||
s, | |||
action ) do { p = calloc(l, s); if(p == NULL) { _alpm_alloc_fail(l * s); action; } } while(0) |
Referenced by add_fileconflict(), alpm_db_update(), alpm_dep_from_string(), alpm_fetch_pkgurl(), alpm_trans_init(), canonicalize_path(), compute_download_size(), conflict_new(), curl_check_finished_download(), depmiss_new(), download_files(), local_db_read(), mount_point_list(), and parse_descfile().
#define CHECK_HANDLE | ( | handle, | |
action ) do { if(!(handle)) { action; } (handle)->pm_errno = ALPM_ERR_OK; } while(0) |
Referenced by alpm_add_pkg(), alpm_checkconflicts(), alpm_checkdeps(), alpm_db_update(), alpm_fetch_pkgurl(), alpm_find_dbs_satisfier(), alpm_get_localdb(), alpm_get_syncdbs(), alpm_option_add_assumeinstalled(), alpm_option_add_cachedir(), alpm_option_add_hookdir(), alpm_option_get_architectures(), alpm_option_get_assumeinstalled(), alpm_option_get_cachedirs(), alpm_option_get_checkspace(), alpm_option_get_dbext(), alpm_option_get_dbpath(), alpm_option_get_default_siglevel(), alpm_option_get_dlcb(), alpm_option_get_dlcb_ctx(), alpm_option_get_eventcb(), alpm_option_get_eventcb_ctx(), alpm_option_get_fetchcb(), alpm_option_get_fetchcb_ctx(), alpm_option_get_gpgdir(), alpm_option_get_hookdirs(), alpm_option_get_ignoregroups(), alpm_option_get_ignorepkgs(), alpm_option_get_local_file_siglevel(), alpm_option_get_lockfile(), alpm_option_get_logcb(), alpm_option_get_logcb_ctx(), alpm_option_get_logfile(), alpm_option_get_noextracts(), alpm_option_get_noupgrades(), alpm_option_get_overwrite_files(), alpm_option_get_parallel_downloads(), alpm_option_get_progresscb(), alpm_option_get_progresscb_ctx(), alpm_option_get_questioncb(), alpm_option_get_questioncb_ctx(), alpm_option_get_remote_file_siglevel(), alpm_option_get_root(), alpm_option_get_sandboxuser(), alpm_option_get_usesyslog(), alpm_option_remove_architecture(), alpm_option_remove_assumeinstalled(), alpm_option_remove_cachedir(), alpm_option_remove_hookdir(), alpm_option_set_architectures(), alpm_option_set_assumeinstalled(), alpm_option_set_cachedirs(), alpm_option_set_checkspace(), alpm_option_set_dbext(), alpm_option_set_default_siglevel(), alpm_option_set_disable_dl_timeout(), alpm_option_set_disable_sandbox(), alpm_option_set_dlcb(), alpm_option_set_eventcb(), alpm_option_set_fetchcb(), alpm_option_set_gpgdir(), alpm_option_set_hookdirs(), alpm_option_set_local_file_siglevel(), alpm_option_set_logcb(), alpm_option_set_logfile(), alpm_option_set_parallel_downloads(), alpm_option_set_progresscb(), alpm_option_set_questioncb(), alpm_option_set_remote_file_siglevel(), alpm_option_set_sandboxuser(), alpm_option_set_usesyslog(), alpm_pkg_load(), alpm_register_syncdb(), alpm_release(), alpm_remove_pkg(), alpm_sync_sysupgrade(), alpm_trans_commit(), alpm_trans_get_add(), alpm_trans_get_flags(), alpm_trans_get_remove(), alpm_trans_init(), alpm_trans_interrupt(), alpm_trans_prepare(), alpm_trans_release(), and alpm_unregister_all_syncdbs().
#define FREE | ( | p | ) | do { free(p); p = NULL; } while(0) |
Referenced by alpm_conflict_free(), alpm_db_update(), alpm_dep_free(), alpm_depmissing_free(), alpm_fetch_pkgurl(), alpm_fileconflict_free(), alpm_option_remove_architecture(), alpm_option_remove_cachedir(), alpm_option_remove_hookdir(), alpm_option_set_dbext(), alpm_option_set_logfile(), alpm_option_set_sandboxuser(), alpm_pkg_checkmd5sum(), alpm_pkg_get_sig(), compute_download_size(), curl_check_finished_download(), curl_retry_next_server(), download_files(), extract_single_file(), finalize_download_locations(), find_dl_candidates(), local_db_read(), mount_point_list_free(), move_file(), parse_descfile(), prepare_resumable_downloads(), prompt_to_delete(), sync_db_read(), and unlink_file().
#define GOTO_ERR | ( | handle, | |
err, | |||
label ) |
Referenced by _cache_mtree_open(), alpm_db_update(), alpm_fetch_pkgurl(), alpm_pkg_get_sig(), build_filelist_from_mtree(), curl_add_payload(), curl_check_finished_download(), download_files(), and sync_db_populate().
#define MALLOC | ( | p, | |
s, | |||
action ) do { p = malloc(s); if(p == NULL) { _alpm_alloc_fail(s); action; } } while(0) |
Referenced by add_entry_to_files_list(), alpm_db_update(), alpm_decode_signature(), alpm_dep_compute_string(), alpm_initialize(), check_arch(), check_validity(), create_tempfile(), curl_add_payload(), curl_check_finished_download(), curl_retry_next_server(), finalize_download_locations(), find_dl_candidates(), get_sync_dir(), key_search_keyserver(), local_db_read(), payload_download_fetchcb(), pkghash_add_pkg(), read_sigfile(), and unlink_file().
#define O_BINARY 0 |
#define OPEN | ( | fd, | |
path, | |||
flags ) do { fd = open(path, flags | O_BINARY); } while(fd == -1 && errno == EINTR) |
Referenced by commit_single_pkg().
#define REALLOC | ( | p, | |
s, | |||
action ) do { void* np = realloc(p, s); if(np == NULL) { _alpm_alloc_fail(s); action; } else { p = np; } } while(0) |
Referenced by local_db_read(), and sync_db_read().
#define RET_ERR | ( | handle, | |
err, | |||
ret ) |
Referenced by _package_changelog_read(), add_fileconflict(), alpm_add_pkg(), alpm_db_add_cache_server(), alpm_db_add_server(), alpm_db_check_pgp_signature(), alpm_db_get_group(), alpm_db_get_pkg(), alpm_db_remove_cache_server(), alpm_db_remove_server(), alpm_db_search(), alpm_db_unregister(), alpm_fetch_pkgurl(), alpm_find_dbs_satisfier(), alpm_option_add_assumeinstalled(), alpm_option_add_cachedir(), alpm_option_add_hookdir(), alpm_option_remove_cachedir(), alpm_option_remove_hookdir(), alpm_option_set_dbext(), alpm_option_set_default_siglevel(), alpm_option_set_gpgdir(), alpm_option_set_local_file_siglevel(), alpm_option_set_logfile(), alpm_option_set_parallel_downloads(), alpm_option_set_remote_file_siglevel(), alpm_option_set_sandboxuser(), alpm_pkg_check_pgp_signature(), alpm_pkg_checkmd5sum(), alpm_pkg_get_sig(), alpm_pkg_load(), alpm_pkg_set_reason(), alpm_register_syncdb(), alpm_release(), alpm_remove_pkg(), alpm_sync_sysupgrade(), alpm_trans_commit(), alpm_trans_get_add(), alpm_trans_get_flags(), alpm_trans_get_remove(), alpm_trans_init(), alpm_trans_prepare(), alpm_trans_release(), alpm_unregister_all_syncdbs(), check_arch(), check_pkg_field_matches_db(), check_validity(), checkdbdir(), compute_download_size(), create_tempfile(), curl_check_finished_download(), curl_retry_next_server(), find_dl_candidates(), get_sync_dir(), init_gpgme(), key_search_keyserver(), load_packages(), load_pkg_for_entry(), local_db_create(), local_db_populate(), local_db_validate(), mount_point_list(), payload_download_fetchcb(), remove_package_files(), sync_db_populate(), and unlink_file().
#define RET_ERR_ASYNC_SAFE | ( | handle, | |
err, | |||
ret ) |
Referenced by alpm_trans_interrupt(), and alpm_unlock().
#define RET_ERR_VOID | ( | handle, | |
err ) |
#define STRDUP | ( | r, | |
s, | |||
action ) do { if(s != NULL) { r = strdup(s); if(r == NULL) { _alpm_alloc_fail(strlen(s)); action; } } else { r = NULL; } } while(0) |
Referenced by add_entry_to_files_list(), add_fileconflict(), alpm_db_update(), alpm_dep_from_string(), alpm_fetch_pkgurl(), alpm_initialize(), alpm_option_set_dbext(), alpm_option_set_logfile(), alpm_option_set_sandboxuser(), create_tempfile(), curl_check_finished_download(), depmiss_new(), download_files(), mount_point_list(), parse_descfile(), sanitize_url(), and sync_db_read().
#define STRNDUP | ( | r, | |
s, | |||
l, | |||
action ) do { if(s != NULL) { r = strndup(s, l); if(r == NULL) { _alpm_alloc_fail(l); action; } } else { r = NULL; } } while(0) |
Referenced by alpm_dep_from_string(), and email_from_uid().
#define SYMEXPORT __attribute__((visibility("default"))) |
#define UNUSED __attribute__((unused)) |
char * strsep | ( | char ** | str, |
const char * | delims ) |
Extracts tokens from a string.
Replaces strset which is not portable (missing on Solaris). Copyright (c) 2001 by François Gouget <fgouget_at_codeweavers.com> Modifies str to point to the first character after the token if one is found, or NULL if one is not.
str | string containing delimited tokens to parse |
delim | character delimiting tokens in str |